Add additional Random.atfork() to prevent RNG errors in large runs
This commit is contained in:
parent
7b545ff46d
commit
41f45668b8
|
@ -1505,6 +1505,10 @@ class Transport (threading.Thread):
|
||||||
# indefinitely, creating a GC cycle and not letting Transport ever be
|
# indefinitely, creating a GC cycle and not letting Transport ever be
|
||||||
# GC'd. it's a bug in Thread.)
|
# GC'd. it's a bug in Thread.)
|
||||||
|
|
||||||
|
# Required to prevent RNG errors when running inside many subprocess
|
||||||
|
# containers.
|
||||||
|
Random.atfork()
|
||||||
|
|
||||||
# active=True occurs before the thread is launched, to avoid a race
|
# active=True occurs before the thread is launched, to avoid a race
|
||||||
_active_threads.append(self)
|
_active_threads.append(self)
|
||||||
if self.server_mode:
|
if self.server_mode:
|
||||||
|
|
Loading…
Reference in New Issue