Skip to content

HDDS-17441. Interrupted short-circuit GetBlock fails with NPE and leaves the received block file stream open in XceiverClientShortCircuit - #11835

Merged
Gargi-jais11 merged 2 commits into
apache:masterfrom
Gargi-jais11:HDDS-17441
Oct 30, 2026

Conversation

@Gargi-jais11

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

There are two problems in XceiverClientShortCircuit when a caller gives up on a short-circuit GetBlock:

  • NPE on interrupt. If the reading thread is interrupted while waiting for the response, sendCommandWithTraceID records neither a response nor an exception. Objects.requireNonNull(ioException) then throws a NPE, which skips the gRPC fallback in BlockInputStream.
  • Leaked descriptor. The datanode still answers the request, and the client caches the block file stream it receives. Nobody ever claims that stream, so the file descriptor stays open for the life of the client process. The same happens when a validator rejects a successful response.

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-17441

How was this patch tested?

Added TestXceiverServerDomainSocket#testClientReleasesStreamOfAbandonedRequest

@Gargi-jais11

Copy link
Copy Markdown
Contributor Author

@ChenSammi this is ready for review

@ChenSammi ChenSammi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks @Gargi-jais11 , LGTM.

@Gargi-jais11
Gargi-jais11 marked this pull request as ready for review October 29, 2026 11:12
@Gargi-jais11
Gargi-jais11 merged commit b1ab4df into apache:master Oct 30, 2026
134 checks passed
@Gargi-jais11

Copy link
Copy Markdown
Contributor Author

Thanks @ChenSammi for reviewing the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants