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

HttpURLConnection timeouts with Expect: 100-Continue and no chunking

    XMLWordPrintable

Details

    • b22
    • x86
    • linux
    • Verified

    Backports

      Description

        FULL PRODUCT VERSION :
        java version "1.7.0_04"
        Java(TM) SE Runtime Environment (build 1.7.0_04-b20)
        Java HotSpot(TM) 64-Bit Server VM (build 23.0-b21, mixed mode)

        ADDITIONAL OS VERSION INFORMATION :
        Linux rigi 3.4.7 #1 SMP Tue Aug 7 10:18:59 CEST 2012 x86_64 Intel(R) Xeon(R) CPU E31225 @ 3.10GHz GenuineIntel GNU/Linux

        The Bug is OS independent

        A DESCRIPTION OF THE PROBLEM :
        It is cool that the JDK now (after ~10 years of the first report) finally supports (and is therefore HTTP 1.1 conform) the expectation header. Really cool would it be if it would also work.

        If chunking is disabled (the Http-Header contains a Content-Length field) and the Expect: 100-Continue header is set, the connection times-out on a POST request, because nothing is written to the wire and both endpoints awaiting input.

        Simple testcases would prevent such bugs. And please test it also with a proxy, authentication and such before you mark this bug as fixed. I don't expect a fix in the next few years, but will not loose my hope...

        STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
        - disable chunking
        - enable Expectation
        - Send a Post request

        EXPECTED VERSUS ACTUAL BEHAVIOR :
        EXPECTED -
        An answer from the server
        ACTUAL -
        Timeout

        ERROR MESSAGES/STACK TRACES THAT OCCUR :
        java.net.SocketTimeoutException: Read timed out

        REPRODUCIBILITY :
        This bug can be reproduced always.

        <snip> - I've attached the testcase to bug report.

        Attachments

          Issue Links

            Activity

              People

                dclarke Darragh Clarke
                coffeys Sean Coffey
                Votes:
                0 Vote for this issue
                Watchers:
                11 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:
                  Imported: