Skip to content

HDDS-16421. Close the stream's block file when a request is rejected on the stream - #11250

Open
ss77892 wants to merge 1 commit into
apache:masterfrom
ss77892:HDDS-16421
Open

ss77892 wants to merge 1 commit into
apache:masterfrom
ss77892:HDDS-16421

Conversation

@ss77892

@ss77892 ss77892 commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

readBlockImpl reports an out of range offset with StreamObserver.onError, which ends the call from the datanode side. GrpcXceiverService closes the stream's RandomAccessFileChannel only when the client completes the stream or a request throws, so the block file stayed open. rejectReadBlock closes it before reporting the error.

Improvements to TestKeyValueHandler. Replace the readBlock helper with a StreamFixture for multi-request ReadBlock tests. The old helper wrote one zero-filled block, sent one request and closed the block file, so a test could neither send several requests on one stream nor check the state of the stream's block file. StreamFixture keeps the container, block and RandomAccessFileChannel for the test's lifetime, appends chunks whose bytes encode their position, and assertResponses checks the streamed data against that. No test behavior changes. Those changes would be required for several followups including HDDS-16377

What is the link to the Apache JIRA

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

How was this patch tested?

UTs
freon/warp workloads

…on the stream

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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.

1 participant