Message269783
We had problem where at some point python start consuming RAM. Until it ends.
The reason was race condition in subprocess.Popen. Which triggered gc.disable() and never gc.enable().
The workaround we use is:
subprocess.gc.isenabled = lambda: True
The scenario for race condition is pretty obvious looking into the code below:
gc_was_enabled = gc.isenabled() <- T1 gets false here
gc.disable()
try:
self.pid = os.fork() <- while T2 is here
except:
if gc_was_enabled:
gc.enable()
raise
... CODE FRAGMENT 1 ...
if gc_was_enabled:
gc.enable()
Also I wonder if exception fails in "... CODE FRAGMENT 1 ..." why don't we re-enable gc (finally block) |
|
Date |
User |
Action |
Args |
2016-07-04 12:52:32 | aonishuk | set | recipients:
+ aonishuk |
2016-07-04 12:52:32 | aonishuk | set | messageid: <1467636752.08.0.502936379731.issue27448@psf.upfronthosting.co.za> |
2016-07-04 12:52:32 | aonishuk | link | issue27448 messages |
2016-07-04 12:52:31 | aonishuk | create | |
|