RFR: 8266761: AssertionError in sun.net.httpserver.ServerImpl.responseCompleted

Daniel Fuchs dfuchs at openjdk.java.net
Fri May 7 20:12:48 UTC 2021


Please find here a fix to prevent an assertion error from firing in the com.sun.net.httpserver.

The issue occurs systematically when all of these conditions are met:

1. System assertions are enabled
2. The handler doesn't read or close the request input stream
3. The handler sends a reply with no content (just headers, but no body)
3. The handler doesn't close the response output stream
4. The handler doesn't close the HttpExchange

The test fails with the assertion error when run without the fix (provided system assertions are enabled) and passes with the fix.


Commit messages:
 - 8266761: AssertionError in sun.net.httpserver.ServerImpl.responseCompleted

Changes: https://git.openjdk.java.net/jdk/pull/3923/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=3923&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8266761
  Stats: 198 lines in 3 files changed: 194 ins; 4 del; 0 mod
  Patch: https://git.openjdk.java.net/jdk/pull/3923.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/3923/head:pull/3923

PR: https://git.openjdk.java.net/jdk/pull/3923

More information about the net-dev mailing list