-
Bug
-
Resolution: Fixed
-
P4
-
None
-
None
-
b20
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8351862 | 21.0.8-oracle | Kieran Farrell | P4 | Resolved | Fixed | master |
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)."
- backported by
-
JDK-8351862 Wrong timeout computations in DnsClient
-
- Resolved
-
- duplicates
-
JDK-8337720 Test com/sun/jndi/dns/ConfigTests/Timeout.java fails with C1 mode by fastdebug binary
-
- Closed
-
- relates to
-
JDK-8220213 com/sun/jndi/dns/ConfigTests/Timeout.java failed intermittent
-
- Closed
-
- links to
-
Commit(master) openjdk/jdk/4beb7719
-
Review(master) openjdk/jdk/20892