Skip to content

Conversation

@note35
Copy link
Contributor

@note35 note35 commented Dec 11, 2025

Test with

  1. ./python -m test test_interpreters test_struct
  2. ./python -m test test_interpreters test_concurrent_futures.test_interpreter_pool

We don't need to make singleton picklabe based on the current tests.
@note35 note35 force-pushed the gh-142414-singleton-removal branch from 2b1d0f1 to b128769 Compare December 11, 2025 16:07
@note35 note35 force-pushed the gh-142414-singleton-removal branch from c7cf990 to f74dcf9 Compare December 12, 2025 08:54
@note35 note35 requested a review from ZeroIntensity December 12, 2025 08:54
@note35 note35 requested a review from vstinner December 12, 2025 13:02
@note35 note35 requested a review from vstinner December 12, 2025 13:16
Comment on lines +430 to +433
except queues.QueueEmpty:
# GH-142414: reloading the _queues module makes get to raise
# queues.QueueEmpty instead of interpreters.QueueEmpty.
pass
Copy link
Member

Choose a reason for hiding this comment

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

I'd like for this to be in a separate PR with a better test case.

Copy link
Contributor Author

@note35 note35 Dec 12, 2025

Choose a reason for hiding this comment

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

The fix is needed otherwise ./python Lib/test/test_runpy.py will run forever.

If a better test case is needed, we can introduce it in the same PR.

I haven’t yet figured out how the combination test causes this in a single test, I’ll need some more time to figure out that.

Copy link
Member

Choose a reason for hiding this comment

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

That doesn't seem related to this PR. Can you reproduce the same infinite loop on main?

Copy link
Contributor Author

@note35 note35 Dec 12, 2025

Choose a reason for hiding this comment

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

Yes, the main branch has no issue because there’s no unbound reload (unbound is directly declared in queues) before this fix. The loop happens along with this fix.

Copy link
Contributor Author

@note35 note35 Dec 12, 2025

Choose a reason for hiding this comment

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

I think twice.

The existing test suite should already provide sufficient coverage. Since test_interpreter_pool naturally fails with deadlock when the issue exists. So we don't need an additional dedicated test if the test modifications in the PR is considered a legitimate bug fix (not workarounds).

./python -m test test_interpreters test_concurrent_futures.test_interpreter_pool 
1. Before this fix: test_interpreters failed
2. After this fix: test_concurrent_futures.test_interpreter_pool failed without this catch
3. After this fix with the catch: all passed

@note35 note35 requested a review from ZeroIntensity December 12, 2025 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants