You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 30, 2019. It is now read-only.
I believe the documentation for pool.on('error') is inaccurate/incomplete.
The documentation directs users to "handle this in the same way you would treat process.on('uncaughtException')". The uncaughtException event discourages users from recovering the application: "Unhandled exceptions inherently mean that an application is in an undefined state. Attempting to resume application code without properly recovering from the exception can cause additional unforeseen and unpredictable issues."
After reading through brianc/node-postgres#1075 and brianc/node-postgres#1558. @charmander briefly mentions that pg.Pool will handle reconnecting pg.Client after restarting Postgres: "A pg.Pool will handle this for you, even if you never want more than one client."
Given that pg.Pool can recover from client errors, I think this should be included in the documentation about error handling.
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Greetings everyone,
I believe the documentation for
pool.on('error')
is inaccurate/incomplete.The documentation directs users to "handle this in the same way you would treat process.on('uncaughtException')". The uncaughtException event discourages users from recovering the application: "Unhandled exceptions inherently mean that an application is in an undefined state. Attempting to resume application code without properly recovering from the exception can cause additional unforeseen and unpredictable issues."
After reading through brianc/node-postgres#1075 and brianc/node-postgres#1558. @charmander briefly mentions that pg.Pool will handle reconnecting pg.Client after restarting Postgres: "A pg.Pool will handle this for you, even if you never want more than one client."
Given that pg.Pool can recover from client errors, I think this should be included in the documentation about error handling.
The text was updated successfully, but these errors were encountered: