Skip to content

Connection reset with server in hot standby #48

Closed
@vharitonsky

Description

@vharitonsky

Currently connection reset does the following:
asyncpg v0.7.0
connection.py:370

async def reset(self):
        self._listeners = {}
        await self.execute('''
            SET SESSION AUTHORIZATION DEFAULT;
            RESET ALL;
            CLOSE ALL;
            UNLISTEN *;
            SELECT pg_advisory_unlock_all();
        ''')

Which is totally incomatible with postgresql in hot standby mode:

Transactions started during hot standby will never be assigned a transaction ID and cannot write to the system write-ahead log. Therefore, the following actions will produce error messages:
...
LISTEN, UNLISTEN, NOTIFY

Maybe there is a way to explicitly listen and then unlisten only in case listen command was issued?

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions