-
-
Notifications
You must be signed in to change notification settings - Fork 16.1k
ensure the side which enbale SO_LINGER and call showdownOutput to start TCP half-closure in fin_wait2 state can still receive and process the data which is send by another side in the close_wait state #11982
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
ensure the side which enbale SO_LINGER and call showdownOutput to start TCP half-closure in fin_wait2 state can still receive and process the data which is send by another side in the close_wait state #11982
Conversation
…rt TCP half-closure in fin_wait2 state can still receive and process the data which is send by another side in the close_wait state。
…rt TCP half-closure in fin_wait2 state can still receive and process the data which is send by another side in the close_wait state。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few comments :)
testsuite/src/main/java/io/netty/testsuite/transport/socket/SocketHalfClosedTest.java
Outdated
Show resolved
Hide resolved
testsuite/src/main/java/io/netty/testsuite/transport/socket/SocketHalfClosedTest.java
Outdated
Show resolved
Hide resolved
testsuite/src/main/java/io/netty/testsuite/transport/socket/SocketHalfClosedTest.java
Outdated
Show resolved
Hide resolved
testsuite/src/main/java/io/netty/testsuite/transport/socket/SocketHalfClosedTest.java
Outdated
Show resolved
Hide resolved
testsuite/src/main/java/io/netty/testsuite/transport/socket/SocketHalfClosedTest.java
Outdated
Show resolved
Hide resolved
testsuite/src/main/java/io/netty/testsuite/transport/socket/SocketHalfClosedTest.java
Show resolved
Hide resolved
testsuite/src/main/java/io/netty/testsuite/transport/socket/SocketHalfClosedTest.java
Outdated
Show resolved
Hide resolved
@huibinliupush did you sigh our ICLA yet ? |
@normanmaurer yeah I already signed it before |
Co-authored-by: Norman Maurer <norman_maurer@apple.com>
Co-authored-by: Norman Maurer <norman_maurer@apple.com>
Co-authored-by: Norman Maurer <norman_maurer@apple.com>
- delete codec in the test channel pipeline - use CountdownLatch to wait the halfClosure to finish - call ReferenceCountUtil.release(msg) in the channelRead handler - follow the same structure for tests, ensures the test will be run for NIO,OIO,Epoll and Kqueue
testsuite/src/main/java/io/netty/testsuite/transport/socket/SocketHalfClosedTest.java
Outdated
Show resolved
Hide resolved
testsuite/src/main/java/io/netty/testsuite/transport/socket/SocketHalfClosedTest.java
Outdated
Show resolved
Hide resolved
testsuite/src/main/java/io/netty/testsuite/transport/socket/SocketHalfClosedTest.java
Outdated
Show resolved
Hide resolved
testsuite/src/main/java/io/netty/testsuite/transport/socket/SocketHalfClosedTest.java
Outdated
Show resolved
Hide resolved
testsuite/src/main/java/io/netty/testsuite/transport/socket/SocketHalfClosedTest.java
Outdated
Show resolved
Hide resolved
testsuite/src/main/java/io/netty/testsuite/transport/socket/SocketHalfClosedTest.java
Outdated
Show resolved
Hide resolved
testsuite/src/main/java/io/netty/testsuite/transport/socket/SocketHalfClosedTest.java
Outdated
Show resolved
Hide resolved
testsuite/src/main/java/io/netty/testsuite/transport/socket/SocketHalfClosedTest.java
Outdated
Show resolved
Hide resolved
…cketHalfClosedTest.java Co-authored-by: Norman Maurer <norman_maurer@apple.com>
…cketHalfClosedTest.java Co-authored-by: Norman Maurer <norman_maurer@apple.com>
…cketHalfClosedTest.java Co-authored-by: Norman Maurer <norman_maurer@apple.com>
…cketHalfClosedTest.java Co-authored-by: Norman Maurer <norman_maurer@apple.com>
…cketHalfClosedTest.java Co-authored-by: Norman Maurer <norman_maurer@apple.com>
…cketHalfClosedTest.java Co-authored-by: Norman Maurer <norman_maurer@apple.com>
…cketHalfClosedTest.java Co-authored-by: Norman Maurer <norman_maurer@apple.com>
@huibinliupush please fix check style error:
|
@normanmaurer fix it |
@huibinliupush I think we are almost there.. Please also fix these:
|
@normanmaurer my intellij checksytle plugin reported error but did not prompt specific error information, so it took me some time,sorry about that |
@huibinliupush thanks a lot ! |
…rt TCP half-closure in fin_wait2 state can still receive and process the data which is send by another side in the close_wait state (#11982) Motivation: we can not call `doDeregister` to cancel the key of the channel from the selector in the `io.netty.channel.AbstractChannel.AbstractUnsafe#shutdownOutput(io.netty.channel.ChannelPromise, java.lang.Throwable)` method。 - because we should ensure the side which enbale `SO_LINGER` and call `showdownOutput` to start TCP half-closure in fin_wait2 state can still receive and process the data which is send by another side in the close_wait state。 - and the shutdown function does not block regardless of the SO_LINGER setting on the socket,so we don't need to use GlobalEventExecutor to execute the shutdown Modification: In summary there is no need to call `prepareToClose()` in the `AbstractChannel.AbstractUnsafe#shutdownOutput` method Result: Fixes issue #11981 client in the FIN_WAIT2 state can read and process these data which is sended by server in the CLOSE_WAIT state,when SO_LINGGER is used in the TCP half-closed scenario Co-authored-by: Norman Maurer <norman_maurer@apple.com>
@normanmaurer so grateful to have learned so much from you,also thank you very much for reviewing this PR |
…rt TCP half-closure in fin_wait2 state can still receive and process the data which is send by another side in the close_wait state (netty#11982) Motivation: we can not call `doDeregister` to cancel the key of the channel from the selector in the `io.netty.channel.AbstractChannel.AbstractUnsafe#shutdownOutput(io.netty.channel.ChannelPromise, java.lang.Throwable)` method。 - because we should ensure the side which enbale `SO_LINGER` and call `showdownOutput` to start TCP half-closure in fin_wait2 state can still receive and process the data which is send by another side in the close_wait state。 - and the shutdown function does not block regardless of the SO_LINGER setting on the socket,so we don't need to use GlobalEventExecutor to execute the shutdown Modification: In summary there is no need to call `prepareToClose()` in the `AbstractChannel.AbstractUnsafe#shutdownOutput` method Result: Fixes issue netty#11981 client in the FIN_WAIT2 state can read and process these data which is sended by server in the CLOSE_WAIT state,when SO_LINGGER is used in the TCP half-closed scenario Co-authored-by: Norman Maurer <norman_maurer@apple.com>
…rt TCP half-closure in fin_wait2 state can still receive and process the data which is send by another side in the close_wait state (netty#11982) Motivation: we can not call `doDeregister` to cancel the key of the channel from the selector in the `io.netty.channel.AbstractChannel.AbstractUnsafe#shutdownOutput(io.netty.channel.ChannelPromise, java.lang.Throwable)` method。 - because we should ensure the side which enbale `SO_LINGER` and call `showdownOutput` to start TCP half-closure in fin_wait2 state can still receive and process the data which is send by another side in the close_wait state。 - and the shutdown function does not block regardless of the SO_LINGER setting on the socket,so we don't need to use GlobalEventExecutor to execute the shutdown Modification: In summary there is no need to call `prepareToClose()` in the `AbstractChannel.AbstractUnsafe#shutdownOutput` method Result: Fixes issue netty#11981 client in the FIN_WAIT2 state can read and process these data which is sended by server in the CLOSE_WAIT state,when SO_LINGGER is used in the TCP half-closed scenario Co-authored-by: Norman Maurer <norman_maurer@apple.com>
Motivation:
we can not call
doDeregister
to cancel the key of the channel from the selector in theio.netty.channel.AbstractChannel.AbstractUnsafe#shutdownOutput(io.netty.channel.ChannelPromise, java.lang.Throwable)
method。because we should ensure the side which enbale
SO_LINGER
and callshowdownOutput
to start TCP half-closure in fin_wait2 state can still receive and process the data which is send by another side in the close_wait state。and the shutdown function does not block regardless of the SO_LINGER setting on the socket,so we don't need to use GlobalEventExecutor to execute the shutdown
Modification:
In summary there is no need to call
prepareToClose()
in theAbstractChannel.AbstractUnsafe#shutdownOutput
methodResult:
Fixes issue #11981
client in the FIN_WAIT2 state can read and process these data which is sended by server in the CLOSE_WAIT state,when SO_LINGGER is used in the TCP half-closed scenario