aboutsummaryrefslogtreecommitdiffstats
path: root/agent/findkey.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2023-10-02 10:53:41 +0000
committerWerner Koch <[email protected]>2023-10-02 12:45:19 +0000
commit9a3e41c151febbbe5506283e2edef85d1d4ea94f (patch)
tree90b361ca1a7a39defb64e06e9e8c03c21d6f5233 /agent/findkey.c
parentdirmngr: Add code to support the negotiation auth method. (diff)
downloadgnupg-9a3e41c151febbbe5506283e2edef85d1d4ea94f.tar.gz
gnupg-9a3e41c151febbbe5506283e2edef85d1d4ea94f.zip
common: Improve lock strategy for dotlock.
* common/dotlock.c (next_wait_interval): New. (dotlock_take_unix): Use new function. (dotlock_take_w32): Ditto. -- In particular when using a dotlock file for protecting the spawning and several processes try to spawn the agent or another component, we often run into long delays. The solution is to is to exponential backoff and also to reduce the initial delay from 50ms to 4ms. We further limit the maximum wait period to about 2 seconds and then repeat at intervals of 512, 1024 and 2048ms. In the wait-forever case we add a small random value to have different intervals per process. GnuPG-bug-id: 3380 For testing this code snippet in the spawning function might be useful: const char *s; if ((s=getenv("hold_gpg_file"))) while (!gnupg_access (s, F_OK)) gnupg_sleep (1);
Diffstat (limited to 'agent/findkey.c')
0 files changed, 0 insertions, 0 deletions