Gregory P. Smith <g...@krypto.org> added the comment:

That custom DebugHandler's emit() implementation that calls into one or more 
sub-handlers suggests that libreswan _might_ be able to fix it in the custom 
DebugHandler by implementing custom acquire() and release() methods... BUT that 
is a fundamentally flawed problem: It requires acquiring multiple locks in a 
single atomic operation OR guaranteeing that they will always be acquired in a 
single specific order.

Given the logging module's fork-time code maintains no order, even implementing 
a custom acquire() and release() method in your custom DebugHandler would not 
be sufficient as sub-handler locks could be acquired first during fork.  also, 
that would be assuming your sub-handlers are not also used directly elsewhere 
within all possible coexisting logger configurations.

An implementable _gross workaround_ that libreswan or anything else in this 
boat could implement satisfying that constraint would be to force all 
potentially related handlers to share the same single RLock instance.  :(

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue36533>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to