Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 1431749
Summary: | gpg2 wastes a whole second waiting for gpg-agent to start | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Miloslav Trmač <mitr> |
Component: | gnupg2 | Assignee: | Tomas Mraz <tmraz> |
Status: | CLOSED ERRATA | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | 24 | CC: | bcl, jamielinux, tmraz |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | gnupg2-2.1.20-2.fc26 | Doc Type: | If docs needed, set a value |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2017-04-27 20:54:39 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
gnupg2-2.1.20-1.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2017-f2b99a5ac7 gnupg2-2.1.20-1.fc26 has been pushed to the Fedora 26 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-f2b99a5ac7 gnupg2-2.1.20-2.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2017-f2b99a5ac7 gnupg2-2.1.20-2.fc26 has been pushed to the Fedora 26 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-f2b99a5ac7 gnupg2-2.1.20-2.fc26 has been pushed to the Fedora 26 stable repository. If problems still persist, please make note of it in this bug report. Thanks for the fix. Has it been sent upstream? Now it has https://dev.gnupg.org/T3380 Thanks again! |
Description of problem: common/asshelp.c:start_new_gpg_agent does (skipping error handling and similar non-important code): > err = gnupg_spawn_process_detached (program? program : agent_program, > argv, NULL); > for (i=0; i < SECS_TO_WAIT_FOR_AGENT; i++) > { > gnupg_sleep (1); > err = assuan_socket_connect (ctx, sockname, 0, 0); > if (!err) > break; > } As a result, even when the agent is ready to accept a connection very quickly (less than 2 ms in my case), gpg2 is waiting for a _whole second_ before trying to connect at all. This extremely noticeably slows down automated gpg runs, where each run creates a new $GNUPGHOME and imports a set of keys into it. Please speed this up, perhaps implementing exponential backoff (1/2/4/8/… ms up to the current 1 s, or so), or perhaps teaching gpg-agent to close a single-purpose pipe after its listen() succeeds, so that gpg-agent can create such a p ipe and block until it is closed = try to connect as soon as possible instead of having to guess how long to wait. Version-Release number of selected component (if applicable): gnupg2-2.1.13-2.fc24.x86_64 (observation) gnupg2-2.1.18-2.fc26.src.rpm (examined source code) Steps to Reproduce: 1. mkdir t 2. (time GNUPGHOME=$(pwd)/t gpg2 --list-keys) 3. (time GNUPGHOME=$(pwd)/t gpg2 --import < ~/.gnupg/pubring.gpg) 3. (time GNUPGHOME=$(pwd)/t gpg2 --import < ~/.gnupg/pubring.gpg) Actual results: 2. takes 0.004 seconds (all values real time) 3. autostarts the agent, and takes 1.012 seconds 4. reuses an existing agent, and takes 0.013 seconds Expected results: 3. takes less than, say, 0.30 seconds