Skip to content

Handle missing notifications in recv/get_event #562

@maxdml

Description

@maxdml

Today it is possible that a notification from the backend is missed and recv/get_event sleep until the entire timout, even as the awaited value is present in the database.

Consider this scenario:

  • Postgres emit a notification on the connection opened with the application
  • Postgres crashes before the notification is sent on the wire
  • Postgres restart, the notification connection is re-established (by error handling on the application side), but never re-emit the notification
  • The application is never notified.

In TypeScript, we handle this by periodically polling Postgres. In Golang, we have a mechanism for the listener loop to signal, through a channel, all the consumers that they should read from the database because the listener connection was lost.

Ideally we'd implement the later in Python.

Metadata

Metadata

Assignees

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