GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |
GeezerVison is showing github.com — Auto-port 4.2: Don't stop reading domain datagrams after an empty datagram by netty-project-bot · Pull Request #18408 · netty/netty Conversation
Contributor
Auto-port of #18395 to 4.2 Motivation:
Modification:
A zero-length datagram on a connected domain datagram channel is still indistinguishable from EOF because Result: All datagrams are delivered when a read loop starts with an empty datagram on the epoll and kqueue domain datagram channels. No public API change, nothing potentially breaking.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactionsMotivation: `DatagramUnicastTest#testSendEmptyDatagramsInOneFlush` fails sporadically on CI for `EpollDomainDatagramChannel` with `received [A, ]`: the datagrams that follow an empty one are never delivered. `MaxMessageHandle.continueReading(...)` requires `totalBytesRead > 0`, and a zero-length datagram does not add to it. When a read loop starts with an empty datagram, the loop ends after reading it. Epoll is edge-triggered, so the datagrams still queued in the socket buffer never raise another `EPOLLIN` and stay unread. Whether this happens depends on how the sender and receiver interleave. `EpollDatagramChannel` already avoids this with `Math.max(1, bytesRead)`; the domain datagram channels did not. Modification: - `EpollDomainDatagramChannel` and `KQueueDomainDatagramChannel` report at least 1 byte to the `RecvByteBufAllocator.Handle` for an unconnected zero-length datagram, while still using the real size for the buffer's writer index. - Add `DatagramUnicastTest#testEmptyDatagramStartsReadLoop`, which waits for the first read loop to complete so that the next one deterministically starts with an empty datagram. A zero-length datagram on a *connected* domain datagram channel is still indistinguishable from EOF because `Socket.recv(...)` maps 0 to -1. That is not changed here. Result: All datagrams are delivered when a read loop starts with an empty datagram on the epoll and kqueue domain datagram channels. No public API change, nothing potentially breaking. (cherry picked from commit cf1a2a8) The 4.1 version of the test used sendToAddress(...), which does not exist in 4.2. Use convertAnyAddress(...) instead, like the other tests in the class.
|
There was an error while loading. Please reload this page.
✅ All tests passed ✅🏷️ Commit: 7818c87 Learn more about TestLens at testlens.app/docs. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.