forked from netty/netty
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FIX: force a read operation for peer instead of self (netty#7454)
* FIX: force a read operation for peer instead of self Motivation: When A is in `writeInProgress` and call self close, A should `finishPeerRead` for B(A' peer). Modifications: Call `finishPeerRead` with peer in `LocalChannel#doClose` Result: Clear confuse of code logic * FIX: preserves order of close after write in same event loop Motivation: If client and server(client's peer channel) are in same event loop, client writes data to server in `ChannelActive`. Server receives the data and write it back. The client's read can't be triggered becasue client's `ChannelActive` is not finished at this point and its `readInProgress` is false. Then server closes itself, it will also close the client's channel. And client has no chance to receive the data. Modifications: 1. Add a test case to demonstrate the problem 2. When `doClose` peer, we always call `peer.eventLoop().execute()` and `registerInProgress` is not needed. 3. Remove test case `testClosePeerInWritePromiseCompleteSameEventLoopPreservesOrder`. This test case can't pass becasue of this commit. IMHO, I think it is OK, becasue it is reasonable that the client flushes the data to socket, then server close the channel without received the data. 4. For mismatch test in SniClientTest, the client should receive server's alert before closed(caused by server's close) Result: The problem is gone.
- Loading branch information
1 parent
0cac1a6
commit 805ac00
Showing
3 changed files
with
94 additions
and
116 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters