fix: prevent premature lock cleanup in multiprocess mode
- Change cleanup condition from count == 1 to count == 0 to properly remove reused locks from cleanup list - Fix RuntimeError: Attempting to release lock for xxxx more times than it was acquired
This commit is contained in:
parent
03b40937f7
commit
85cd1178a1
1 changed files with 1 additions and 1 deletions
|
|
@ -422,7 +422,7 @@ def _get_or_create_shared_raw_mp_lock(
|
||||||
f"Shared-Data lock registry for {factory_name} is corrupted for key {key}"
|
f"Shared-Data lock registry for {factory_name} is corrupted for key {key}"
|
||||||
)
|
)
|
||||||
if (
|
if (
|
||||||
count == 1 and combined_key in _lock_cleanup_data
|
count == 0 and combined_key in _lock_cleanup_data
|
||||||
): # Reusing an key waiting for cleanup, remove it from cleanup list
|
): # Reusing an key waiting for cleanup, remove it from cleanup list
|
||||||
_lock_cleanup_data.pop(combined_key)
|
_lock_cleanup_data.pop(combined_key)
|
||||||
count += 1
|
count += 1
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue