[WIP][Workaround] Skip ident comparison to avoid crash on Python 3.13+#1031
[WIP][Workaround] Skip ident comparison to avoid crash on Python 3.13+#10314383 wants to merge 2 commits into
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1031 +/- ##
======================================
- Coverage 56% 55% -1%
======================================
Files 89 89
Lines 9852 9868 +16
Branches 1772 1774 +2
======================================
- Hits 5575 5523 -52
- Misses 3913 3983 +70
+ Partials 364 362 -2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Python 3.13 introduced major internal changes to thread management as part of PEP 703 (GIL removal), including native thread handles and joinable threads. These changes modified how thread identifiers are defined and used in the standard library, breaking compatibility with Eventlet's monkey-patched threading model. The issue decribed in eventlet#1030 is related to the GIL and PEP 703 because Python 3.13 introduced internal thread handles and joinable threads to support the no-GIL mode, changing how thread identifiers are managed: instead of simple values, they are now internal native identifiers handled at the C level, tied to OS-level threads or new CPython thread structures. Since Eventlet is deeply tied to green threads and emulates standard threads using greenlet-based constructs, properly adapting to Python 3.13 would require a near-complete rewrite of its threading logic. As a temporary workaround, this commit skips the comparison of thread identifiers to avoid AttributeErrors and restore partial functionality under Python 3.13+. A full fix will need a deeper architectural review. Related to eventlet#1030
d9e2166 to
8815c8a
Compare
itamarst
left a comment
There was a problem hiding this comment.
Could you include some sort of test that passes now and failed previously? So at least we know we're not regressing if we have to make future changes.
|
Sure, will do that. |
|
Well, I think we have many problems here. The first one is that I think our recent job refactor was a bit invasive and apparently we accidentally removed all the jobs execution, tests are missing. So I think we have to restore a transient version of our previous github actions to restore the execution of our unit tests. The second one is that this patch broke more 40 unit tests (local run), but in parallel it fix the reproducer shared with us in the issue. Both kind of tests should execute successfully. So this patch need further works or another approach to manage the reproducer. |
|
I have come up with a more fundamental solution for #1030, at least. |
Python 3.13 introduced major internal changes to thread management as part of PEP 703 (GIL removal), including native thread handles and joinable threads. These changes modified how thread identifiers are defined and used in the standard library, breaking compatibility with Eventlet's monkey-patched threading model.
The issue decribed in #1030 is related to the GIL and PEP 703 because Python 3.13 introduced internal thread handles and joinable threads to support the no-GIL mode, changing how thread identifiers are managed: instead of simple values, they are now internal native identifiers handled at the C level, tied to OS-level threads or new CPython thread structures.
Since Eventlet is deeply tied to green threads and emulates standard threads using greenlet-based constructs, properly adapting to Python 3.13 would require a near-complete rewrite of its threading logic.
As a temporary workaround, this commit skips the comparison of thread identifiers to avoid AttributeErrors and restore partial functionality under Python 3.13+.
A full fix will need a deeper architectural review.
Related to #1030