Skip to content

Open Psycopg connections deleted during shutdown #1612

Description

@pjonsson

Had this message flash by when I deleted the OWS pod in Kubernetes:

"Traceback (most recent call last):  File \"/app/lib/python3.14/site-packages/psycopg/_connection_base.py\", line 153, in __del__ResourceWarning: <psycopg.Connection object at 0x7ac9cf582f90> was deleted while still open. Please use 'with' or '.close()' to close the connection properly"
"Exception ignored while calling deallocator <function BaseConnection.__del__ at 0x7ac9cfcdf740>:"
"Traceback (most recent call last):  File \"/app/lib/python3.14/site-packages/psycopg/_connection_base.py\", line 153, in __del__ResourceWarning: <psycopg.Connection object at 0x7ac9cfd66f90> was deleted while still open. Please use 'with' or '.close()' to close the connection properly"

I'm not sure how the shutdown of gunicorn works, but it's possible OWS should be catching SIGTERM and try to exit nicely when getting that signal.

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