Skip to content

Conversation

@lidavidm
Copy link
Member

@lidavidm lidavidm commented Jun 5, 2025

The driver manager was leaking array streams in the case that you executed a query, did not fetch the result, then did another operation. In this case, because the stream was never imported, it would silently leak. Avoid this by explicitly/directly releasing any extant array stream before another driver operation.

The driver manager was leaking array streams in the case that
you executed a query, *did not fetch the result*, then did another
operation.  In this case, because the stream was never imported,
it would silently leak.  Avoid this by explicitly/directly
releasing any extant array stream before another driver operation.
@lidavidm lidavidm marked this pull request as ready for review June 5, 2025 03:25
@github-actions github-actions bot added this to the ADBC Libraries 19 milestone Jun 5, 2025
"""
if self.stream.release != NULL:
self.stream.release(&self.stream)
self.stream.release = NULL
Copy link
Member

Choose a reason for hiding this comment

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

is there a magic python magic func we can utilize here? like __del__?

Copy link
Member Author

Choose a reason for hiding this comment

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

It's already implemented on the Cursor which will implicitly free everything else now. We could perhaps add it here too?

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated

Copy link
Member Author

Choose a reason for hiding this comment

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

I also added the methods to ArrowArray/ArrowSchema even though they're not used

@lidavidm lidavidm requested a review from zeroshade June 9, 2025 05:19
Copy link
Member

@zeroshade zeroshade left a comment

Choose a reason for hiding this comment

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

Looks good to me, just one question beyond the CI failing

if self._results is not None:
self._results.close()
self._results = None
self._clear()
Copy link
Member

Choose a reason for hiding this comment

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

Should _clear just imply close and closed=true?

Copy link
Member Author

Choose a reason for hiding this comment

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

Er, no, because this object can be reused and _clear is used below, so the only thing it should do is free any allocated array stream

Copy link
Member

Choose a reason for hiding this comment

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

Gotcha. Then all good!

@lidavidm
Copy link
Member Author

lidavidm commented Jun 9, 2025

@zeroshade the CI failing is some bug with arrow-go where Flight SQL is returning an EOF from some internal reader as an actual error, which I've never managed to track down

@lidavidm
Copy link
Member Author

lidavidm commented Jun 9, 2025

Ah wait I do need to update the PYI it appears

@lidavidm lidavidm merged commit 4430379 into apache:main Jun 9, 2025
62 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants