Skip to content

Commit

Permalink
NetSocket implementation can redeliver the same buffer when paused fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
vietj committed Sep 1, 2016
1 parent bf73d2f commit 1adf3f0
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/main/java/io/vertx/core/net/impl/NetSocketImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,7 @@ synchronized void handleDataReceived(Buffer data) {
}
if (pendingData != null) {
data = pendingData.appendBuffer(data);
pendingData = null;
}
reportBytesRead(data.length());
if (dataHandler != null) {
Expand Down

4 comments on commit 1adf3f0

@luengnat
Copy link

Choose a reason for hiding this comment

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

no way to test this?

@vietj
Copy link
Member Author

@vietj vietj commented on 1adf3f0 Sep 1, 2016

Choose a reason for hiding this comment

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

no, I've been able to reproduce it with this though (that's how I found it) : https://github.com/vietj/back-pressure-test (in FrontClient.java) but was not able to come up with a test.

when the NetSocket is paused Netty autoread is set to false, it can only be reproduced when autoread is to set false and a buffer is being delivered at the same time (or almost), which happens in the back-pressure-test

@vietj
Copy link
Member Author

@vietj vietj commented on 1adf3f0 Sep 1, 2016

Choose a reason for hiding this comment

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

I sent a note on vertx-dev, if you can create a reproducer that would be great.

@luengnat
Copy link

Choose a reason for hiding this comment

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

Let me try

Please sign in to comment.