Skip to content

PostgreSQL: server closed the connection unexpectedly #357

@kovaxur

Description

@kovaxur

Hi,
I started to use ponyorm for my project, I found the following problem:

Steps to reproduce:

  1. I start my application, everything is fine, I can work with the database properly
    (2. I can do stress tests all night, everything goes well)
  2. If I don't do anything for like 10-15 minutes and then I try to execute something, I get the following exception message:

server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.

Trace:
File \"<string>\", line 2, in __iter__\n","  File \"/usr/lib/python3.6/site-packages/pony/utils/utils.py\", line 58, in cut_traceback\n    return func(*args, **kwargs)\n","  
File \"/usr/lib/python3.6/site-packages/pony/orm/core.py\", line 5506, in __iter__\n    return iter(query._fetch())\n","  
File \"/usr/lib/python3.6/site-packages/pony/orm/core.py\", line 5343, in _fetch\n    cursor = database._exec_sql(sql, arguments)\n","  
File \"/usr/lib/python3.6/site-packages/pony/orm/core.py\", line 820, in _exec_sql\n    connection = cache.reconnect(e)\n","  
File \"/usr/lib/python3.6/site-packages/pony/orm/core.py\", line 1625, in reconnect\n    if not provider.should_reconnect(exc): reraise(*sys.exc_info())\n","  
File \"/usr/lib/python3.6/site-packages/pony/utils/utils.py\", line 87, in reraise\n    try: raise exc.with_traceback(tb)\n"," 
File \"/usr/lib/python3.6/site-packages/pony/orm/core.py\", line 818, in _exec_sql\n    try: new_id = provider.execute(cursor, sql, arguments, returning_id)\n","  File \"<string>\", line 2, in execute\n","  
File \"/usr/lib/python3.6/site-packages/pony/orm/dbapiprovider.py\", line 61, in wrap_dbapi_exceptions\n    raise OperationalError(e)\n"

Versions:

pony.__version__
'0.7.3'
psycopg2.__version__
'2.7.5 (dt dec pq3 ext lo64)'
python 3.6

Maybe this is rather an architectural problem in my code, however I used the same model as in the examples.

Thanks

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