Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8279916

Reading from Pipe may hang on Windows

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • 16, 17, 18, 19
    • core-libs
    • None
    • Microsoft Windows 10 Pro [10.0.19042 Build 19042]

      (on behalf of Alexey Pavlyutkin)

      If a consumer is fast enough to read out all the data from a pipe and call WSARecv() again on empty socket then blocking WSARecv() call may ignore closing of producer's end and never returns. Accordingly to https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-wsarecv

      {quote}
      Windows Sockets 2 does not define any standard blocking time-out mechanism for this function. For protocols acting as byte-stream protocols the stack tries to return as much data as possible subject to the available buffer space and amount of received data available. However, receipt of a single byte is sufficient to unblock the caller.
      {quote}

      See the attached reproducer.

            apavlyutkin Alexey Pavlyutkin
            akozlov Anton Kozlov
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: