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

AssertionError: Thread.__init__() not called #2020

Closed
wilson3q opened this issue Feb 7, 2024 · 2 comments
Closed

AssertionError: Thread.__init__() not called #2020

wilson3q opened this issue Feb 7, 2024 · 2 comments

Comments

@wilson3q
Copy link

wilson3q commented Feb 7, 2024

  • gevent version: 23.9.1
  • Python version: 3.12.2
  • Operating System: Linux

Description:

The following assertion failure after upgrading to python 3.12.2. Please take a look at the threading monkey patch. I have reported a similar issue to python dev.

Exception ignored in: <function _after_fork at 0x7f04dd0b0400>
Traceback (most recent call last):
  File "/home/scm/lib/python3.12/threading.py", line 1691, in _after_fork
    thread._set_tstate_lock()
  File "/home/scm/lib/python3.12/threading.py", line 1051, in _set_tstate_lock
    if not self.daemon:
           ^^^^^^^^^^^
  File "/home/scm/lib/python3.12/threading.py", line 1246, in daemon
    assert self._initialized, "Thread.__init__() not called"
AssertionError: Thread.__init__() not called

What I've run:

I was running gevent together with gunicorn to provide rest services. Never have issues before python 3.12.2.

In _DummyThread definition, super init was not called, which caused assertion failures.

def __init__(self): # pylint:disable=super-init-not-called
        #_DummyThread_.__init__(self)
@serhiy-storchaka
Copy link

Also note that the code in 3.13 is different from 3.12, so it may be broken again.

@mashley310
Copy link

I'm also seeing this issue after upgrading from python 3.11.7 to 3.11.8.

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

No branches or pull requests

3 participants