You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This will print "connecting to db" and hang. If you comment out line psycogreen.gevent.patch_psycopg() # noqa code will fail with OperationalError in couple seconds.
The text was updated successfully, but these errors were encountered:
Desired behavior can be achieved, if I replace psycogreen.gevent.patch_psycopg() with
from psycogreen.gevent import gevent_wait_callback
from psycopg2 import extensions
from functools import partial
extensions.set_wait_callback(partial(gevent_wait_callback, timeout=1))
Yes, I'm aware: in async mode the libpq doesn't respect the connect_timeout, it is the client which should re-implement it. So this is actually a psycopg2 problem. There might be a ticket open for it already... yup, this: psycopg/psycopg2#944
python version 3.8.6
library versions:
gevent==20.9.0
greenlet==0.4.17
psycogreen==1.0.2
psycopg2==2.8.6
minimal example:
This will print "connecting to db" and hang. If you comment out line
psycogreen.gevent.patch_psycopg() # noqa
code will fail with OperationalError in couple seconds.The text was updated successfully, but these errors were encountered: