Merge pull request #1072 from zmedico/gateway-cache-rinfo

Cache execnet gateway rinfo during WorkerController setup
This commit is contained in:
Ran Benita
2024-04-28 22:17:03 +03:00
committed by GitHub
2 changed files with 6 additions and 0 deletions

1
changelog/1071.bugfix Normal file
View File

@@ -0,0 +1 @@
Add backward compatibility for deadlock issue with the ``execnet`` new ``main_thread_only`` "execmodel" triggered when pytest-cov accesses rinfo.

View File

@@ -312,6 +312,11 @@ class WorkerController:
def setup(self) -> None: def setup(self) -> None:
self.log("setting up worker session") 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 spec = self.gateway.spec
args = [str(x) for x in self.config.invocation_params.args or ()] args = [str(x) for x in self.config.invocation_params.args or ()]
option_dict = {} option_dict = {}