-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Don't leave cursors open #23993
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
Don't leave cursors open #23993
Conversation
|
/backport to stable20 |
rullzer
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks sane.
🚀
kesselb
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice 👍
Signed-off-by: Joas Schilling <[email protected]>
c59ae47 to
8027dcb
Compare
|
closing the cursor before a return makes no functional difference and only clutters the code, the cursor will be closed automatically when the result goes out of scope. it only makes sense to manually close cursors if there is significant work being done in a function after the results are fetched |
Was about to ask this as well. It looks really odd that we need to actively close the cursor there. Does this really fix the OCI cursor leak? |
|
Well at least the OC_DB methods leave cursors behind I don't know why and how, maybe because of the static-ness. |
|
And then I think it doesn't hurt and we should just make it a pattern in our code base. So when someone adds a second query or some code after your query they dont need to magically remember to add a closeCursor for the query above |
MorrisJobke
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fine by me
Signed-off-by: Joas Schilling [email protected]