Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix a deadlock involve
scheduler.all_digests
, and add a note. (pant…
…sbuild#11723) ### Problem By chance, a garbage collection thread started up and called `lease_files_in_graph` while I happened to be running Pants in the foreground. This caused a deadlock because `lease_files_in_graph` was not releasing the GIL before touching the `Graph` (via the `Scheduler`)... and foreground interactions with the `Graph` frequently need to acquire the GIL to check for equality. ### Solution Move the problematic call to `scheduler.all_digests()` under `allow_threads` and add a note. Additionally, move one other potentially-problematic method call under `allow_threads`. ### Result A rare (hopefully?) deadlock is prevented. See pantsbuild#11722 for how we might make this less likely in the future. [ci skip-build-wheels]# Delete this line to force CI to run the JVM tests. [ci skip-jvm-tests]
- Loading branch information