Skip to content

Commit

Permalink
Always send ChannelInputShutdownReadComplete in epoll (#14042)
Browse files Browse the repository at this point in the history
Motivation:
We were observing EpollSocketHalfClosedTest was occasionally failing.
This appears to be because we were clearing EPOLLIN when we shouldn't,
and prevent ourselves from getting the RDHUP where we send the
ChannelInputShutdownReadComplete event.

Modification:
Predicate the `clearEpollIn0()` call on `shouldStopReading(config())`,
so we continue to try reading when reads are queued.
This allows us to get another RDHUP which we will turn into the
read-complete event.

Result:
We no longer miss out on read-complete events from input shut down.
  • Loading branch information
chrisvest committed May 10, 2024
1 parent 47f2a78 commit c660d84
Showing 1 changed file with 3 additions and 1 deletion.
Expand Up @@ -567,7 +567,9 @@ void shutdownInput(boolean rdHup) {
// We attempted to shutdown and failed, which means the input has already effectively been
// shutdown.
}
clearEpollIn0();
if (shouldStopReading(config())) {
clearEpollIn0();
}
pipeline().fireUserEventTriggered(ChannelInputShutdownEvent.INSTANCE);
} else {
close(voidPromise());
Expand Down

0 comments on commit c660d84

Please sign in to comment.