Open iOrcohen opened 1 year ago
Thanks for reporting this issue. I think we could do this, but I would prefer pass it as an option.
Thanks for the quick answer ! I would be love to open a PR if you like, with the option to enable this.
Sure, a PR would be highly appreciated :pray:
Could you please explain how would you like to approach this?
I was thinking to pass an array additionalConnectionsState: ['idle in transaction', 'idle in transaction (aborted)', 'disabled']
, but feel free to suggest whatever works best.
Currently, the clean function in our application does not properly handle connections in the "idle in transaction" and "idle in transaction (aborted)" states, leading to potential issues and resource leaks. This problem occurs when connections are left open but not actively executing any queries, resulting in a waste of system resources and potential conflicts.
To address this problem, we need to update the clean function to properly handle these connection states. The function should be able to identify and close connections that are stuck in either "idle in transaction" or "idle in transaction (aborted)" states, ensuring that our application maintains a healthy and efficient connection pool.
We are solving this issue right now by creating a patch for the NPM with the following changes in the code -
in 3 occurrences in
src/index.js
-Changed to -