Open codebanesr opened 9 months ago
The error originates here, and it only happens when i try to run the app with gunicorn and eventlet
This sounds incredibly similar to #2848.
EDIT:
In #2848, we found out that basically gevent monkey-patches some things in the select
module and that breaks things for trio. Apparently this is intended according to https://github.com/gevent/gevent/issues/2008.
According to gunicorn docs (https://docs.gunicorn.org/en/stable/settings.html#worker-class),
apparently you might want to create a subclass for gunicorn.workers.base.Worker
that uses trio
EDIT II: It might be worth looking into https://github.com/pgjones/hypercorn, which is also a wsgi server. I've personally had a lot of success working with it (my project sane scanner server uses it), and it has built-in support for a trio worker class.
The error originates here, and it only happens when i try to run the app with gunicorn and eventlet
right yeah, if we're getting here in the logic then we're neither on windows nor linux (true), and the select
module does not appear to have kqueue
(so apparently gevent.select
does not have kqueue
either. So indeed similar to #2848, but would not be resolved by #2928.
Yeah in #2928 I could make things work via gevent.monkey.get_original
but I don't think that's really the right behavior. That will make trio.run
block, I think.
Not entirely sure what is the best outcome to have here.
@codebanesr does this still fail? That PR was merged a while ago but I forgot to check back here.
I am using mysql-connector in a flask env . I have gevent for sockets, and the trio still errors out on mac. Im just using mac for development purposes.any way we can get past this in a mac
I am using mysql-connector in a flask env . I have gevent for sockets, and the trio still errors out on mac. Im just using mac for development purposes.any way we can get past this in a mac
Sorry I forgot about one extra workaround I should have specified in your issue: httpx, or well really httpcore as of 1.0.6 handles trio raising this error as if trio doesn't exist. So you might be able to bump your dependencies and that will fix things.
Description: I'm encountering a
NotImplementedError: unsupported platform
which causes my Gunicorn worker process to fail. This seems to be originating from the httpx/trio libraries. Has anyone else experienced similar issues?Error Traceback:
Environment:
OS: Mac M2 [darwin]
Python: 3.11.7
Gunicorn: version 21.2.0
httpx: Version (output of
pip show httpx
)trio: Version (output of
pip show trio
)Let me know if any more details are necessary.