Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-7831

SocketTimeoutException when previous response was exactly chunk length bytes

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.2.6
    • 3.2.7, 3.3.0
    • Transports
    • None
    • Unknown

    Description

      When using the Asynchronous Client HTTP Transport we get a SocketTimeout exception when the previous response was exactly the same length as the chunk length by default 16320 bytes.

      After some investigation we have found that the problem is that when the http connection is returned to PoolingNHttpClientConnectionManager the SelectionKey's interestOps does not contain OP_READ. The input gets suspended in SharedInputBuffer when the buffer is full (16320 bytes by default) if this happens at the same time as the endOfStream is reached more input is never requested. We have fixed it locally by adding an endOfStream check before suspending input in SharedInputBuffer. This might not be the correct place to fix it since you could argue that it should not be the responsibility of the user of PoolingNHttpClientConnectionManager to return the http connection in the correct state.

       

      An example project to reproduce the problem is attached in asyncbugtest.zip and a patch with our fix is in Check_endOfStream_before_suspending_input.patch

       

       

      Attachments

        1. asyncbugtest.zip
          6 kB
          Jan Hallonsten
        2. Check_endOfStream_before_suspending_input.patch
          0.9 kB
          Jan Hallonsten

        Activity

          People

            ffang Freeman Yue Fang
            hallonbat Jan Hallonsten
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: