Thanks to visit codestin.com
Credit goes to github.com

Skip to content

uWSGI fails to start with "--py-call-osafterfork" on Python 3.13 (work with Python 3.12) #2710

@TheBlusky

Description

@TheBlusky

Using uwsgi 2.0.28, simply running the uwsgi --master --http=8080 --py-call-osafterfork command on an empty environment.

  • With python 3.13
$ docker run --rm -it python:3.13 bash
root@a2a21e201c85:/# pip install uwsgi
[...]
Successfully installed uwsgi-2.0.28
root@a2a21e201c85:/# uwsgi --master --http=8080 --py-call-osafterfork
*** Starting uWSGI 2.0.28 (64bit) on [Fri Mar 21 16:40:33 2025] ***
[...]
*** uWSGI is running in multiple interpreter mode ***
spawned uWSGI master process (pid: 609)
spawned uWSGI worker 1 (pid: 610, cores: 1)
Fatal Python error: PyMutex_Unlock: unlocking mutex that is not locked
Python runtime state: initialized

Current thread 0x00007ff7a3c42480 (most recent call first):
spawned uWSGI http 1 (pid: 611)
  <no Python frame>
DAMN ! worker 1 (pid: 610) died, killed by signal 6 :( trying respawn ...
Respawned uWSGI worker 1 (new pid: 612)
Fatal Python error: PyMutex_Unlock: unlocking mutex that is not locked
Python runtime state: initialized

Current thread 0x00007ff7a3c42480 (most recent call first):
  <no Python frame>
DAMN ! worker 1 (pid: 612) died, killed by signal 6 :( trying respawn ...
worker respawning too fast !!! i have to sleep a bit (2 seconds)...
^CSIGINT/SIGTERM received...killing workers...
gateway "uWSGI http 1" has been buried (pid: 611)
Respawned uWSGI worker 1 (new pid: 613)
Fatal Python error: PyMutex_Unlock: unlocking mutex that is not locked
Python runtime state: initialized

The module is looping on the last error: Fatal Python error: PyMutex_Unlock: unlocking mutex that is not locked

  • With python 3.12
$ docker run --rm -it python:3.12 bash
root@7af8ba226d73:/# pip install uwsgi
[...]
root@7af8ba226d73:/# uwsgi --master --http=8080 --py-call-osafterfork
*** Starting uWSGI 2.0.28 (64bit) on [Fri Mar 21 16:38:51 2025] ***
[...]
spawned uWSGI master process (pid: 607)
spawned uWSGI worker 1 (pid: 608, cores: 1)
spawned uWSGI http 1 (pid: 609)

It's working fine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions