Skip to content

Commit

Permalink
Merge pull request #1072 from zmedico/gateway-cache-rinfo
Browse files Browse the repository at this point in the history
Cache execnet gateway rinfo during WorkerController setup
  • Loading branch information
bluetech authored Apr 28, 2024
2 parents c93a106 + 12b3cce commit b397288
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions changelog/1071.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add backward compatibility for deadlock issue with the ``execnet`` new ``main_thread_only`` "execmodel" triggered when pytest-cov accesses rinfo.
5 changes: 5 additions & 0 deletions src/xdist/workermanage.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,11 @@ def shutting_down(self) -> bool:

def setup(self) -> None:
self.log("setting up worker session")
# Cache rinfo for backward compatibility, since pytest-cov
# accesses rinfo while the main thread is busy executing our
# remote_exec call, which triggers a deadlock error for the
# main_thread_only execmodel if the rinfo has not been cached.
self.gateway._rinfo()
spec = self.gateway.spec
args = [str(x) for x in self.config.invocation_params.args or ()]
option_dict = {}
Expand Down

0 comments on commit b397288

Please sign in to comment.