From 41f45668b8058e9be5c60632a51214e56a25f287 Mon Sep 17 00:00:00 2001 From: Jeff Forcier Date: Sun, 23 Oct 2011 00:33:52 -0700 Subject: [PATCH] Add additional Random.atfork() to prevent RNG errors in large runs --- ssh/transport.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ssh/transport.py b/ssh/transport.py index 3b22629..f3d7d24 100644 --- a/ssh/transport.py +++ b/ssh/transport.py @@ -1505,6 +1505,10 @@ class Transport (threading.Thread): # indefinitely, creating a GC cycle and not letting Transport ever be # 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_threads.append(self) if self.server_mode: