Skip to content

fix(csharp/src/Client): Fix some resource management in AdbcDataReader#4134

Open
CurtHagenlocher wants to merge 3 commits intoapache:mainfrom
CurtHagenlocher:ClientFixes
Open

fix(csharp/src/Client): Fix some resource management in AdbcDataReader#4134
CurtHagenlocher wants to merge 3 commits intoapache:mainfrom
CurtHagenlocher:ClientFixes

Conversation

@CurtHagenlocher
Copy link
Contributor

Fixes a few small issues I noticed while reviewing a change recently.

@CurtHagenlocher CurtHagenlocher changed the title Fix some resource management in AdbcDataReader fix(csharp/src/Client): Fix some resource management in AdbcDataReader Mar 24, 2026
@CurtHagenlocher
Copy link
Contributor Author

Can you take a quick look at this @davidhcoe ?

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR improves AdbcDataReader cleanup behavior by centralizing stream disposal and tightening record-batch lifetime management, aiming to prevent leaks and stale reads.

Changes:

  • Refactors Close() to delegate cleanup to Dispose(bool).
  • Ensures the underlying QueryResult.Stream is disposed during reader disposal.
  • Disposes the prior RecordBatch before fetching the next one in Read() to avoid stale data after mid-stream failures.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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