-
Bug
-
Resolution: Fixed
-
P4
-
None
-
None
-
b20
The following issues related to timeout computation in the 'com.sun.jndi.dns.DnsClient' code have been reported here:
https://mail.openjdk.org/pipermail/core-libs-dev/2024-September/128797.html
1. Non-monotonic time source is used to calculate the duration of receive operation:
" long start = System.currentTimeMillis();
gotData = blockingReceive(udpChannel, ipkt, timeoutLeft);
long end = System.currentTimeMillis();
System.currentTimeMillis() is not monotonic and therefore it could happen that end - start < 0"
2. Left timeout value is not correctly decreased:
"int timeoutLeft = pktTimeout;
do {
...
timeoutLeft = pktTimeout - ((int) (end - start));
} while (timeoutLeft > MIN_TIMEOUT);
Here, timeoutLeft is not iteratively decreased, but is always derived from `pktTimeout`.
I can see a case where `timeoutLeft` never drops below `MIN_TIMEOUT` (this is the part where I'm not sure if I'm missing some deeper knowledge)."
https://mail.openjdk.org/pipermail/core-libs-dev/2024-September/128797.html
1. Non-monotonic time source is used to calculate the duration of receive operation:
" long start = System.currentTimeMillis();
gotData = blockingReceive(udpChannel, ipkt, timeoutLeft);
long end = System.currentTimeMillis();
System.currentTimeMillis() is not monotonic and therefore it could happen that end - start < 0"
2. Left timeout value is not correctly decreased:
"int timeoutLeft = pktTimeout;
do {
...
timeoutLeft = pktTimeout - ((int) (end - start));
} while (timeoutLeft > MIN_TIMEOUT);
Here, timeoutLeft is not iteratively decreased, but is always derived from `pktTimeout`.
I can see a case where `timeoutLeft` never drops below `MIN_TIMEOUT` (this is the part where I'm not sure if I'm missing some deeper knowledge)."
- relates to
-
JDK-8220213 com/sun/jndi/dns/ConfigTests/Timeout.java failed intermittent
- Resolved
- links to
-
Commit(master) openjdk/jdk/4beb7719
-
Review(master) openjdk/jdk/20892