Skip to content
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

Always send ChannelInputShutdownReadComplete in epoll #14042

Merged
merged 1 commit into from May 10, 2024

Conversation

chrisvest
Copy link
Contributor

@chrisvest chrisvest commented May 9, 2024

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.

@chrisvest
Copy link
Contributor Author

Made it a draft for now, because I can't run some of the tests in my dev container, so I don't know if this breaks anything or not.

Also, there's a commented-out piece of code that also appears to fix the EpollSocketHalfClosedTest.
I don't know which of the solutions is preferred, or if there's something else we should do.

@normanmaurer
Copy link
Member

Can you point me to the commented code that also fixes it ? Strangely enough it never fails here 🤦‍♂️🤷‍♂️

@chrisvest
Copy link
Contributor Author

Can you point me to the commented code that also fixes it ? Strangely enough it never fails here 🤦‍♂️🤷‍♂️

This change:

https://github.com/netty/netty/pull/14042/files#diff-7ce2eb73cdfce7ee70be45a16a8a8c4412aa69dddd0cac5878068ef6afd199d4R572

@chrisvest
Copy link
Contributor Author

Without this change, it fails for me roughly one in 30 runs.

@normanmaurer
Copy link
Member

Thanks... will have a closer look tomorrow morning

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.
@chrisvest chrisvest marked this pull request as ready for review May 10, 2024 15:36
@chrisvest
Copy link
Contributor Author

@normanmaurer Build is happy with the change. (I think the Graal failure is something else)

@chrisvest chrisvest merged commit c660d84 into netty:4.2 May 10, 2024
16 of 17 checks passed
@chrisvest chrisvest deleted the 4.2-lt-half-closed branch May 10, 2024 22:13
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.

None yet

2 participants