Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache execnet gateway rinfo during WorkerController setup #1072

Merged
merged 1 commit into from
Apr 28, 2024

Conversation

zmedico
Copy link
Contributor

@zmedico zmedico commented Apr 20, 2024

Cache execnet gateway info during WorkerController setup for backward
compatibility, in order to avoid a later main_thread_only deadlock
error triggered when pytest-cov calls rinfo after the main thread is
already busy. See pytest-dev/execnet#274 for corresponding test case.

Fixes: 20e3ac7 ("Use execnet main_thread_only execmodel (#1027)")

I was able not able to reproduce the issue using a small project with pytest-xdist and pytest-cov.

I was able to reproduce it by running tox in a checkout of setuptools, after using pip to install pytest-xdist-3.6.0 into the .tox/py virtualenv. Then I applied this PR to the virtualenv and that fixed the issue, with pytest-cov successfully producing coverage results.

@bluetech
Copy link
Member

This change LGTM, pending pytest-dev/execnet#274 (comment) (and if we decide to fix in xdist instead of execnet, should update the "Remove this after execnet is fixed" comment)

@zmedico zmedico force-pushed the gateway-cache-rinfo branch from 80f9254 to 0a7755d Compare April 27, 2024 18:10
# 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()
Copy link
Contributor Author

@zmedico zmedico Apr 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change LGTM, pending pytest-dev/execnet#274 (comment) (and if we decide to fix in xdist instead of execnet, should update the "Remove this after execnet is fixed" comment)

Okay, comment updated. Noted the change here: #1071 (comment)

Copy link
Member

@bluetech bluetech left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

If there are no further comments, I'll merge this and release 3.6.1.

Cache execnet gateway info during WorkerController setup for backward
compatibility, in order to avoid a later main_thread_only deadlock
error triggered when pytest-cov calls rinfo after the main thread is
already busy. See pytest-dev/execnet#274 for corresponding test case.

Fixes: 20e3ac7 ("Use execnet main_thread_only execmodel (pytest-dev#1027)")
@bluetech bluetech force-pushed the gateway-cache-rinfo branch from 0a7755d to 12b3cce Compare April 28, 2024 19:01
@bluetech bluetech merged commit b397288 into pytest-dev:master Apr 28, 2024
21 checks passed
@zmedico zmedico deleted the gateway-cache-rinfo branch May 12, 2024 22:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants