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

Reading from Pipe may hang on Windows

    XMLWordPrintable

Details

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

    Description

      (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.

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated: