-
Notifications
You must be signed in to change notification settings - Fork 401
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Resolve slow key retrieval when some GPG key servers are not reachable #1016
Conversation
@microsoft-github-policy-service agree |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for contributing, definitely a helpful improvement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks! Let's merge this on Monday to ensure we accidentally don't break anything.
@samruddhikhandale |
At the moment, if the host environment cannot reach first key server over port 11371, it takes 1 minute to retrieve individual keys from the other listed key servers. For the Python feature, the installation script retrieves 13 keys, so the total time to retrieve all the keys is 13 minutes. The delay could be further extended if subsequent servers also cannot be reached.
The reason it takes 1 minute rather than the 15 second default timeout in
dirmngr
is that I believedirmngr
internally tries the connection to the same keyserver 4 times before it moves on to a different server. Essentially, this multiplies the timeout delay by 4.Instead of relying on the
dirmngr
timeout mechanism, the change implements a check for keyserver reachability usingcurl
before the list is passed on todirmngr
.If no keyservers are identified, the script will intentionally fail. If some keyservers are not reachable, the script will log this information, enabling users to more easily identify and resolve network issues in their environments.
Related issues:
#686
#337
#323
Affected features:
I ran tests for all the features locally; most succeeded without issues. The only test that failed was
autoPullDisabled
fromgit-lfs
, but it also fails with unmodified code, so I suspect something else in my environment is causing the tests to fail, not specific to my changes.