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

Fix epoll bug when receiving zero-sized datagrams #12644

Merged
merged 8 commits into from Jul 29, 2022

Commits on Jul 27, 2022

  1. Fix epoll bug when receiving zero-sized datagrams

    Motivation:
    Datagrams are allowed to be empty when sent over UNIX or INET sockets.
    In such cases, we cannot use "received zero bytes" as a signal that no packets were received.
    
    Modification:
    When we receive a zero-sized datagram, tell the EpollRecvByteAllocatorHandle that we really received one byte, because the allocation handles use zero as an end-of-data signal.
    Such signals will put the event loop to rest, which is wrong because we don't know at this point if there are more packets to process.
    Use the absence of a sender-point as signal that no packets were read from recvmsg(2), and then continue to use -1 as the end-of-data signal to allocation handle.
    Add a DatagramUnicastTest to verify that we can receive multiple empty datagrams in a row without the eventloop mistakenly going to sleep.
    
    Result:
    Robust handling of zero-sized datagrams in the epoll transport.
    chrisvest committed Jul 27, 2022
    Copy the full SHA
    770555d View commit details
    Browse the repository at this point in the history
  2. Move tests to DatagramUnicastInetTest because the JDK DatagramPacket …

    …does not support domain sockets
    chrisvest committed Jul 27, 2022
    Copy the full SHA
    a443211 View commit details
    Browse the repository at this point in the history
  3. Revert "Move tests to DatagramUnicastInetTest because the JDK Datagra…

    …mPacket does not support domain sockets"
    
    This reverts commit a443211.
    chrisvest committed Jul 27, 2022
    Copy the full SHA
    3815b41 View commit details
    Browse the repository at this point in the history
  4. Abort the empty datagram test if the address type is not supported by…

    … the JDK DatagramPacket class
    
    As of JDK 20, it still does not support UNIX addresses, but some day it might.
    chrisvest committed Jul 27, 2022
    Copy the full SHA
    d5d97f8 View commit details
    Browse the repository at this point in the history
  5. Copy the full SHA
    d632f45 View commit details
    Browse the repository at this point in the history

Commits on Jul 28, 2022

  1. Copy the full SHA
    81e3e2c View commit details
    Browse the repository at this point in the history
  2. Copy the full SHA
    661de90 View commit details
    Browse the repository at this point in the history
  3. Copy the full SHA
    8a2ce92 View commit details
    Browse the repository at this point in the history