Skip to content

GH-2974: Fix race in TcpNetConnection.getPayload() #2975

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 26, 2019

Conversation

garyrussell
Copy link
Contributor

Fixes #2974

There is a race in that we could get a SocketException in inputStream.
Since this is between payloads, it needs to be thrown as a
SoftEndOfStreamException.

Fixes spring-projects#2974

There is a race in that we could get a `SocketException` in `inputStream`.
Since this is between payloads, it needs to be thrown as a
`SoftEndOfStreamException`.
Copy link
Member

@artembilan artembilan left a comment

Choose a reason for hiding this comment

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

Just a couple suggestions.

inputStream = inputStream();
}
catch (IOException e1) {
throw new UncheckedIOException(new SoftEndOfStreamException("Socket closed when getting input stream", e1));
Copy link
Member

Choose a reason for hiding this comment

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

Can we make a SoftEndOfStreamException as an UncheckedIOException to avoid this wrapping?

i don't mind for other branches, but at least for the master.

Thanks

@@ -38,4 +38,8 @@ public SoftEndOfStreamException(String message) {
super(message);
}

public SoftEndOfStreamException(String message, Throwable cause) {
Copy link
Member

Choose a reason for hiding this comment

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

@since 4.3.21 ?

@artembilan artembilan merged commit 175223d into spring-projects:master Jun 26, 2019
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.

TcpNetConnection: Read exception - Socket is closed
2 participants