Skip to content

GH-2974: Fix race in TcpNetConnection.getPayload() [51x] #2976

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 2 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.

Also fix unnecessary this. in MessageHistoryConfigurer.java.

cherry-pick to 5.0.x, 4.3.x

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`.

Also fix unnecessary `this.` in `MessageHistoryConfigurer.java`.

**cherry-pick to 5.0.x, 4.3.x**
Socket socket = SocketFactory.getDefault().createSocket("localhost", port.get());
TcpNetConnection connection = new TcpNetConnection(socket, false, false, publisher, "socketClosedNextRead");
socket.close();
assertThatThrownBy(() -> connection.getPayload())
Copy link
Member

Choose a reason for hiding this comment

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

This is not going to back-port smoothly: there is no AssertJ in the requested versions.
I'll figure during cherry-picking...

@artembilan artembilan merged commit a75efd3 into spring-projects:5.1.x Jun 26, 2019
@artembilan
Copy link
Member

Cherry-picked into 5.0.x as 93cd669 after fixing conflicts.
Cherry-picked into 4.3.x as 2e7c5d8 with more conflicts resolutions.

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