Skip to content

Conversation

@nickvergessen
Copy link
Member

Signed-off-by: Joas Schilling [email protected]

@nickvergessen nickvergessen added bug 3. to review Waiting for reviews labels Nov 9, 2020
@nickvergessen nickvergessen added this to the Nextcloud 21 milestone Nov 9, 2020
@nickvergessen nickvergessen changed the title Don't leave cursors open when tests fail Don't leave cursors open Nov 9, 2020
@nickvergessen
Copy link
Member Author

/backport to stable20

Copy link
Member

@rullzer rullzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks sane.
🚀

Copy link
Contributor

@kesselb kesselb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice 👍

@nickvergessen nickvergessen force-pushed the bugfix/noid/close-cursors branch from c59ae47 to 8027dcb Compare November 9, 2020 11:29
@icewind1991
Copy link
Member

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

@MorrisJobke
Copy link
Member

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.

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?

@nickvergessen
Copy link
Member Author

Well at least the OC_DB methods leave cursors behind I don't know why and how, maybe because of the static-ness.

@nickvergessen
Copy link
Member Author

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

Copy link
Member

@MorrisJobke MorrisJobke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fine by me

@MorrisJobke MorrisJobke merged commit f23c216 into master Nov 10, 2020
@MorrisJobke MorrisJobke deleted the bugfix/noid/close-cursors branch November 10, 2020 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants