Details

    • Type: Sub-task
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: core-libs

      Description

      BodySubscriber.asInputStream() returns an InputStream.
      The HttpClient selector manager thread will not exit until pending operations are all completed.

      Not reading the input stream may therefore prevent the selector manager thread from exiting, and the HttpClient from being garbage collected until the server eventually times out and closes the connection, as it will appear that some operation is still in progress.

      InputStream::close is linked up to Subscription.cancel, but whether the concrete implementation of that method takes the appropriate corrective action if not all bytes have been read should be evaluated: close the connection if HTTP/1.1, reset the stream if HTTP/2.

      Also the effect of not reading all data and not closing the stream should probably be documented in an @implNote

        Attachments

          Activity

            People

            • Assignee:
              dfuchs Daniel Fuchs
              Reporter:
              dfuchs Daniel Fuchs
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: