File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change 2121import array
2222import queue
2323import time
24+ import os
2425from os import getpid
2526
2627from traceback import format_exc
@@ -1349,6 +1350,14 @@ class SharedMemoryManager(BaseManager):
13491350 _Server = SharedMemoryServer
13501351
13511352 def __init__ (self , * args , ** kwargs ):
1353+ if os .name == "posix" :
1354+ # bpo-36867: Ensure the resource_tracker is running before
1355+ # launching the manager process, so that concurrent
1356+ # shared_memory manipulation both in the manager and in the
1357+ # current process does not create two resource_tracker
1358+ # processes.
1359+ from . import resource_tracker
1360+ resource_tracker .ensure_running ()
13521361 BaseManager .__init__ (self , * args , ** kwargs )
13531362 util .debug (f"{ self .__class__ .__name__ } created by pid { getpid ()} " )
13541363
You can’t perform that action at this time.
0 commit comments