JDK-8251361 : Potential race between Logger configuration and GCs in HttpURLConWithProxy test
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.net
  • Affected Version: 11,16
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2020-08-10
  • Updated: 2024-11-20
  • Resolved: 2020-08-10
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 11 JDK 16
11.0.13-oracleFixed 16 b11Fixed
Related Reports
Relates :  
Description
The issue was reported on the net-dev mailing list:
https://mail.openjdk.java.net/pipermail/net-dev/2020-July/014191.html

There is a subtle timing hole introduced into the HttpURLConWithProxy.java test with the fix for JDK-8183369.
When using GC stress modes, a consistent failure can be observed:

"Execution failed: `main' threw exception: java.lang.RuntimeException: Connection not retried with proxy".

It can be verified that the Proxy is being used but the messages are not being logged with the ProxyHandler. The issue is caused by back to back calls of Logger.getLogger(String). If a GC happens between the two calls
there is no guarantee that the same object will be returned.

Since the test relies on the log messages being handled by the new ProxyHandler to pass, the test needs to ensure the Logger object stays live  for the entire lifetime of the test.
Comments
Fix Request (11u) This stabilizes the test. The patch applies semi-cleanly (CLI thinks there is a conflict, but bots still treat it is clean backport after resolution). Affected test still passes.
09-08-2021

URL: https://hg.openjdk.java.net/jdk/jdk/rev/c3ca340ea62c User: dfuchs Date: 2020-08-10 18:35:19 +0000
10-08-2020