Skip to content

On Python 3.13, "greenlet.error: cannot switch to a different thread" #425

@itamarst

Description

@itamarst

Eventlet runs on greenlet, but on Python 3.13rc2 tests that work on older versions of Python now fail (using this PR: eventlet/eventlet#966, and greenlet 3.1.0):

$ .tox/py313/bin/python tests/isolated/patcher_threading_join.py 
Traceback (most recent call last):
  File "/home/itamarst/devel/eventlet/eventlet/hubs/hub.py", line 471, in fire_timers
    timer()
    ~~~~~^^
  File "/home/itamarst/devel/eventlet/eventlet/hubs/timer.py", line 59, in __call__
    cb(*args, **kw)
    ~~^^^^^^^^^^^^^
  File "/home/itamarst/devel/eventlet/eventlet/semaphore.py", line 147, in _do_acquire
    waiter.switch()
    ~~~~~~~~~~~~~^^
greenlet.error: cannot switch to a different thread

It's not clear if this is greenlet's fault or if eventlet is doing something wrong (but something wrong that used to work!). If you have any hints on how to debug this sort of problem that would be helpful in trying to fix it in eventlet.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Not greenletAn environment problem, or something otherwise not greenlet's faultQuestion

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions