Home GnuPG
Diffusion GnuPG f6728d13e8e5

dirmngr: Lazily launch ldap reaper thread.
f6728d13e8e5Unpublished

Unpublished Commit · Learn More

Not On Permanent Ref: This commit is not an ancestor of any permanent ref.

Description

dirmngr: Lazily launch ldap reaper thread.

* dirmngr/dirmngr.c (main): Avoid calling ldap_wrapper_launch_thread()
Before we need it.
* dirmngr/ldap-wrapper.c (ldap_wrapper): Call
ldap_wrapper_launch_thread() just in time (before any attempt to use
an ldap subprocess).

A dirmngr process that never looks anything up in LDAP has no need for
a reaper thread, but one was started automatically. This thread wakes
up every two seconds to look for ldap processes that might never have
been running. We won't start more than one reaper thread for any
given dirmngr due to the static int "done" in
ldap_wrapper_launch_thread(), so it's safe to call this every time
there is a use of ldap_wrapper.

If someone wants to do further dirmngr optimizations for ldap users,
the reaper thread itself could use dynamically-calculated timeouts
(and probably needs to be alerted dynamically when a new ldap
subprocess is available so it can re-calculate those timeouts).

Note: It's not clear to me how to test ldap access effectively; i know
of no public ldap services that i can verify against, and i do not run
my own ldap servers. If someone has a publicly-available ldap server
that developers can run tests against, i would be happy to hear about
it.

  • Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>

Details

Provenance
dkgAuthored on Nov 1 2016, 12:52 AM
wernerCommitted on Nov 29 2016, 2:32 PM
Parents
rGecc126a7cef3: build: Remove more keywords from the generated ChangeLog
Branches
Unknown
Tags
Unknown

Event Timeline

Werner Koch <wk@gnupg.org> committed rGf6728d13e8e5: dirmngr: Lazily launch ldap reaper thread. (authored by Daniel Kahn Gillmor <dkg@fifthhorseman.net>).Nov 29 2016, 2:32 PM