Skip to content

psycogreen breaks connect_timeout option #2

Closed
@redlolgeerf

Description

@redlolgeerf

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:

import gevent
import gevent.monkey

gevent.monkey.patch_all()  # noqa

import psycogreen.gevent

psycogreen.gevent.patch_psycopg()  # noqa

import psycopg2


def fetch(num, secs):
    print("connecting to db")
    conn = psycopg2.connect("dbname=postgres connect_timeout=1")
    print("connected")


jobs = [gevent.spawn(fetch, 3, 2)]
gevent.joinall(jobs)

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions