-
Notifications
You must be signed in to change notification settings - Fork 276
Open
Description
During graceful shutdowns, Electric doesn't explicitly clean up its Postgres backend connections. We've had issues where we've seen hanging connections and we can't quite explain why. We want to explicitly shutdown the connection to prevent any potential inconsistent states. While this doesn't address crash scenarios, it might help preventing accumulation of stale connections during normal deployment cycles and planned restarts .
Proposed Solution: Track backend PIDs and explicitly terminate them during shutdown sequence using a separate pool connection.
Requirements
- Capture Postgres backend conneciton PID when establishing replication connection
- On graceful shutdown, terminate the backend process
- Defensively clean up replication slots before termination
- Ensure cleanup happens before releasing advisory lock
Metadata
Metadata
Assignees
Labels
No labels