Author gregory.p.smith
Recipients cagney, ebizzinfotech, gregory.p.smith, hugh, lukasz.langa, ned.deily, vstinner
Date 2019-04-10.05:44:20
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1554875061.09.0.932657780053.issue36533@roundup.psfhosted.org>
In-reply-to
Content
> """
Since the documentation seems to be silent the guarantee (or expectation) is implied - logging systems emit records atomically - if this isn't true across fork() then the exception should be documented.
"""

We can add a note to the docs.  As a general rule: documentation being silent means there are zero guarantees.  Behavior of the existing implementations over time is the only source of truth.


> """
but it didn't address the more fundamental problem:

- when the child enters the code 'b' is undefined

i.e., breaking the lock will allow the child to access data in an undefined state.  This will result in either core dumps or hangs (presumably the motivation for the original change was to prevent this?).
"""

nope.  the contrived emit() pseudocode from msg339650 never defined b in the first place.  that code, if massaged into python syntax would raise an UnboundLocalError no matter who executed it.  a fork() from another thread would not change that.  There is no concept of undefined/uninitialized state from the Python perspective.

The motivation for the original fix was entirely deadlock avoidance in code that uses fork.  It failed and introduced an alternate form of deadlock in code that had been lucky up until that point.  Thus my new PR proposing to fix the regression by making that not fail yet still preventing locks from starting out held in the child process.
History
Date User Action Args
2019-04-10 05:44:21gregory.p.smithsetrecipients: + gregory.p.smith, vstinner, ned.deily, lukasz.langa, cagney, hugh, ebizzinfotech
2019-04-10 05:44:21gregory.p.smithsetmessageid: <1554875061.09.0.932657780053.issue36533@roundup.psfhosted.org>
2019-04-10 05:44:21gregory.p.smithlinkissue36533 messages
2019-04-10 05:44:20gregory.p.smithcreate