https://bugs.openldap.org/show_bug.cgi?id=9486
--- Comment #3 from Howard Chu hyc@openldap.org --- (In reply to igfoo from comment #2)
Thanks for the quick response. Unfortunately, in the real code, each process only opens an env once, but two processes might do so at the same time.
Are you referring to the "Opening a database can fail if another process is opening or closing it at exactly the same time." caveat? If so, presumably we could just wait a random amount of time and try again. Is there any documentation anywhere about what these failures might look like?
No, the behavior is undefined.
Your best bet is just to stagger the startup of your processes.