Skip to content

connection was closed in the middle of operation #309

@Jeffwhen

Description

@Jeffwhen
  • asyncpg version: 0.15.0
  • PostgreSQL version: 10.3
  • local PostgreSQL:
  • Python version: 3.6.5
  • Platform: Ubuntu 14.04.5
  • Do you use pgbouncer?: no
  • Did you install asyncpg with pip?: yes

I use asyncpg with sanic. Before server start, a connection pool is made and attached to the app. In every route, the handler acquire a connection if pg access is needed. The problem is, if the pool is silent for too long, new acquired connection is not usable.

asyncpg.exceptions.ConnectionDoesNotExistError: connection was closed in the middle of operation

After one-time exception. The next acquisition is normal again. No exception with queries. Which is really weird for me.

I've tried to twist max_inactive_connection_lifetime parameter, got no luck. Actually I don't quite understand this parameter. Why would I need this parameter?

Any help is welcomed.

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