Skip to content

HDDS-14710. Intermittent "Socket closed" in JacocoServer#9824

Merged
adoroszlai merged 2 commits intoapache:masterfrom
adoroszlai:HDDS-14710
Feb 26, 2026
Merged

HDDS-14710. Intermittent "Socket closed" in JacocoServer#9824
adoroszlai merged 2 commits intoapache:masterfrom
adoroszlai:HDDS-14710

Conversation

@adoroszlai
Copy link
Contributor

What changes were proposed in this pull request?

Acceptance check sometimes encounters this harmless, but confusing error:

Error: Exception in thread "main" java.net.SocketException: Socket closed

Fix JacocoServer to catch the exception.

Also avoid empty statement and suppression.

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

How was this patch tested?

https://github.com/adoroszlai/ozone/actions/runs/22367329262

@adoroszlai adoroszlai self-assigned this Feb 25, 2026
@adoroszlai adoroszlai added the CI label Feb 25, 2026
synchronizedCall(destination::visitClassExecution));
while (reader.read()) {
;//read until the end of the stream.
while (true) {

Choose a reason for hiding this comment

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

its the same logic as before.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, why would it be different? The purpose of this part of the change is to avoid the need for:

@SuppressWarnings("checkstyle:EmptyStatement")

Choose a reason for hiding this comment

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

I'd keep the loop condition as is and add Thread.yield() in the body to get a chance to other thread to fill the buffer for the next read().

Copy link

@yandrey321 yandrey321 left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Contributor

@dombizita dombizita left a comment

Choose a reason for hiding this comment

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

Thanks for fixing this @adoroszlai, looks good to me.

@adoroszlai adoroszlai merged commit 60e4ab1 into apache:master Feb 26, 2026
128 of 130 checks passed
@adoroszlai adoroszlai deleted the HDDS-14710 branch February 26, 2026 15:56
@adoroszlai
Copy link
Contributor Author

Thanks @dombizita, @yandrey321 for the review.

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.

3 participants