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

Hotfix: version fix on python-engineio to debug uWSGI socket issue #1321

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

okayhooni
Copy link
Contributor

fix: #1319
related to: miguelgrinberg/python-engineio#330

python-engineio (version between v4.5.1 and v4.7.0) has some bug on socket close logic.

Due to this issue, Querybook webserver got the error below all the time.

Traceback (most recent call last):
  File "src/gevent/greenlet.py", line 906, in gevent._gevent_cgreenlet.Greenlet.run
  File "/usr/local/lib/python3.9/site-packages/engineio/socket.py", line 223, in writer
    ws.close()
  File "/usr/local/lib/python3.9/site-packages/engineio/async_drivers/gevent_uwsgi.py", line 70, in close
    uwsgi.disconnect()
SystemError: you can call uwsgi api function only from the main callable
2023-09-01T11:35:50Z <Thread at 0x7f63a8909040: writer> failed with SystemError

Traceback (most recent call last):
  File "src/gevent/greenlet.py", line 831, in gevent._gevent_cgreenlet.Greenlet.join
  File "src/gevent/greenlet.py", line 857, in gevent._gevent_cgreenlet.Greenlet.join
  File "src/gevent/greenlet.py", line 846, in gevent._gevent_cgreenlet.Greenlet.join
  File "src/gevent/_greenlet_primitives.py", line 61, in gevent._gevent_c_greenlet_primitives.SwitchOutGreenletWithLoop.switch
  File "src/gevent/_greenlet_primitives.py", line 61, in gevent._gevent_c_greenlet_primitives.SwitchOutGreenletWithLoop.switch
  File "src/gevent/_greenlet_primitives.py", line 65, in gevent._gevent_c_greenlet_primitives.SwitchOutGreenletWithLoop.switch
  File "src/gevent/_gevent_c_greenlet_primitives.pxd", line 35, in gevent._gevent_c_greenlet_primitives._greenlet_switch
  File "src/gevent/greenlet.py", line 906, in gevent._gevent_cgreenlet.Greenlet.run
  File "/usr/local/lib/python3.9/site-packages/engineio/socket.py", line 223, in writer
    ws.close()
  File "/usr/local/lib/python3.9/site-packages/engineio/async_drivers/gevent_uwsgi.py", line 70, in close
    uwsgi.disconnect()
SystemError: you can call uwsgi api function only from the main callable

This issue has been solved by python-engineio version 4.7.1 (released just 5 hours ago).

I deployed and tested Querybook with this version, and the issue was solved.

@jczhong84
Copy link
Collaborator

@okayhooni looks like querybook doesn't directly depend on python-engineio. And I checked the version of python-engineio when running make, it is python-engineio 4.9.0. Is it still an issue on your end if without this PR?

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

Successfully merging this pull request may close these issues.

[uWSGI ~ websocket] SystemError: you can call uwsgi api function only from the main callable
2 participants