See JDK-8039086 for some background.
The issue here is that the following code is not thread safe. A second thread can read cacheJavaTestTimeoutFactor as having the value 1 while it is still being set up by the first thread.
protected float getTimeoutFactor() {
if (cacheJavaTestTimeoutFactor == -1) {
cacheJavaTestTimeoutFactor = 1; // default
try {
// use [1] to get the floating point timeout factor
String f = (regEnv == null ? null : regEnv.lookup("javatestTimeoutFactor")[1]);
if (f != null)
cacheJavaTestTimeoutFactor = Float.parseFloat(f);
} catch (TestEnvironment.Fault e) {
} catch (NumberFormatException e) {
}
}
return cacheJavaTestTimeoutFactor;
}
private static float cacheJavaTestTimeoutFactor = -1;
The issue here is that the following code is not thread safe. A second thread can read cacheJavaTestTimeoutFactor as having the value 1 while it is still being set up by the first thread.
protected float getTimeoutFactor() {
if (cacheJavaTestTimeoutFactor == -1) {
cacheJavaTestTimeoutFactor = 1; // default
try {
// use [1] to get the floating point timeout factor
String f = (regEnv == null ? null : regEnv.lookup("javatestTimeoutFactor")[1]);
if (f != null)
cacheJavaTestTimeoutFactor = Float.parseFloat(f);
} catch (TestEnvironment.Fault e) {
} catch (NumberFormatException e) {
}
}
return cacheJavaTestTimeoutFactor;
}
private static float cacheJavaTestTimeoutFactor = -1;
- blocks
-
JDK-8039086 com/sun/tools/attach/BasicTests.java: timeout with -Xcomp, timeout factor not working
-
- Closed
-
- duplicates
-
JDK-8039086 com/sun/tools/attach/BasicTests.java: timeout with -Xcomp, timeout factor not working
-
- Closed
-
- relates to
-
CODETOOLS-7901307 jtreg sends timeout signal before timeout has passed
-
- Resolved
-