-
Notifications
You must be signed in to change notification settings - Fork 255
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CONNECTION_CLOSED on subscribe() #757
Comments
Just got caught with the same error. And it's causing my database to bloat with the WAL piling up... |
I believe the key problem here is the "subscribe" creates a temporary replication slot on the database. As soon as the database shuts down, that original replication slot is gone forever. Postgres.js at the moment is not smart enough to recreating a new replication slot when the database is back online. @porsager What is really problematic at the moment is that there is no way for us to handle it ourselves in this situation. As the error is being completely swallowed by the stream here. Lines 99 to 107 in 6f20a48
I think even just rethrow the error would be better. Because then I can catch that error using the global "UncaughtException" event. And even if I don't, the program would completely crash and restarted by the container runtime or process manager alike. |
@Louis-Tian right. |
I use standard
and it works well.
When postgres goes down I immediately get
When postgres goes up then I get everything working except for the above subscription -- it never reconnects.
The text was updated successfully, but these errors were encountered: