Skip to content

Comments

RATIS-2407. Missing return statement after stream closed check in OrderedRequestStreamObserver.#1348

Merged
szetszwo merged 1 commit intoapache:masterfrom
slfan1989:RATIS-2407
Feb 14, 2026
Merged

RATIS-2407. Missing return statement after stream closed check in OrderedRequestStreamObserver.#1348
szetszwo merged 1 commit intoapache:masterfrom
slfan1989:RATIS-2407

Conversation

@slfan1989
Copy link
Contributor

What changes were proposed in this pull request?

Expected Behavior

After detecting the stream is closed and reporting the error, the method should return immediately to avoid:

  • Creating unnecessary objects
  • Modifying state of a closed stream
  • Potential memory leaks and state inconsistencies

Solution

Add a return statement after the responseError() call at line 340.

The same method already has correct error handling for group mismatch at line ~354, which includes a return statement after calling responseError(). The stream-closed check should follow the same pattern.

What is the link to the Apache JIRA

JIRA: RATIS-2407. Missing return statement after stream closed check in OrderedRequestStreamObserver.

How was this patch tested?

unit tests.

Copy link
Contributor

@szetszwo szetszwo left a comment

Choose a reason for hiding this comment

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

+1 the change looks good.

@szetszwo szetszwo merged commit 53eba3b into apache:master Feb 14, 2026
16 checks passed
@slfan1989
Copy link
Contributor Author

+1 the change looks good.

@szetszwo Thank you very much for reviewing the code!

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