You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
with FileLock('.lock') as lock:
os.set_inheritable(lock._lock_file_fd, False)
f() # holds the lock, runs multiprocessing
a call to os.set_inheritable(lock._lock_file_fd, False) is required in case f runs multiprocessing, otherwise, in some cases the code gets "stuck". Since there no getter for the lock file fd, it requires to access "private" member. Maybe add the inheritable flag as param in FileLock c'tor? or provide access to lock file fd from API?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
a call to
os.set_inheritable(lock._lock_file_fd, False)
is required in casef
runs multiprocessing, otherwise, in some cases the code gets "stuck". Since there no getter for the lock file fd, it requires to access "private" member. Maybe add the inheritable flag as param inFileLock
c'tor? or provide access to lock file fd from API?UPDATE: I see in fd-inheritance
So I guess
os.set_inheritable(lock._lock_file_fd, False)
does not helpBeta Was this translation helpful? Give feedback.
All reactions