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 19, 2019. It is now read-only.
Obviously it's not the purpose of pg-cursor, but sometimes you do not know type of query in advance, but need to implement a common query execution logic.
If noData (INSERT/UPDATE/DELETE without RETURNING clause) queries are run through cursor then dangling rowDescription events are left on connection. It leads to Node,js memory leak warning.
Simple solution is to clear rowDescription on noData event, like:
However, it seems the code is not completely safe. We need to ensure that all introduced event handlers are removed upon cursor close by (error, noData, done, forced close, etc.)
The text was updated successfully, but these errors were encountered:
andvgal
changed the title
Event handler leak on noDarta queries
Event handler leak on noData queries
Aug 22, 2017
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Obviously it's not the purpose of pg-cursor, but sometimes you do not know type of query in advance, but need to implement a common query execution logic.
If noData (INSERT/UPDATE/DELETE without RETURNING clause) queries are run through cursor then dangling rowDescription events are left on connection. It leads to Node,js memory leak warning.
Simple solution is to clear rowDescription on noData event, like:
However, it seems the code is not completely safe. We need to ensure that all introduced event handlers are removed upon cursor close by (error, noData, done, forced close, etc.)
The text was updated successfully, but these errors were encountered: