[issue14548] garbage collection just after multiprocessing's fork causes exceptions

sbt report at bugs.python.org
Wed Apr 11 18:32:32 CEST 2012


New submission from sbt <shibturn at gmail.com>:

When running test_multiprocessing on Linux I occasionally see a stream of errors caused by ignored weakref callbacks:

  Exception AssertionError: AssertionError() in <Finalize object, dead> ignored

These do not cause the unittests to fail.

Finalizers from the parent process are supposed to be cleared after the fork.  But if a garbage collection before that then Finalizer callbacks can be run in the "wrong" process.

Disabling gc during fork seems to prevent the errors.  Or maybe the Finalizer should record the pid of the process which created it and only invoke the callback if it matches the current pid.

(Compare Issure 1336 conscerning subprocess.)

----------
messages: 158049
nosy: sbt
priority: normal
severity: normal
status: open
title: garbage collection just after multiprocessing's fork causes exceptions

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue14548>
_______________________________________


More information about the Python-bugs-list mailing list