Re: RFR: 8339538: Wrong timeout computations in DnsClient [v11]

2024-10-10 Thread Mark Sheppard
On Mon, 7 Oct 2024 09:00:28 GMT, Aleksei Efimov wrote: >> This PR proposes the following changes to address wrong timeout computations >> in the `com.sun.jndi.dns.DnsClient`: >> - The `DnsClient` has been updated to use a monotonic high-resolution (nano) >> clock. The existing `Timeout` test ha

Re: RFR: 8339538: Wrong timeout computations in DnsClient [v11]

2024-10-10 Thread Mark Sheppard
On Mon, 7 Oct 2024 09:00:28 GMT, Aleksei Efimov wrote: >> This PR proposes the following changes to address wrong timeout computations >> in the `com.sun.jndi.dns.DnsClient`: >> - The `DnsClient` has been updated to use a monotonic high-resolution (nano) >> clock. The existing `Timeout` test ha

Re: RFR: 8339538: Wrong timeout computations in DnsClient [v11]

2024-10-10 Thread Mark Sheppard
On Mon, 7 Oct 2024 09:00:28 GMT, Aleksei Efimov wrote: >> This PR proposes the following changes to address wrong timeout computations >> in the `com.sun.jndi.dns.DnsClient`: >> - The `DnsClient` has been updated to use a monotonic high-resolution (nano) >> clock. The existing `Timeout` test ha

Re: RFR: 8339538: Wrong timeout computations in DnsClient [v11]

2024-10-09 Thread Aleksei Efimov
On Mon, 7 Oct 2024 09:00:28 GMT, Aleksei Efimov wrote: >> This PR proposes the following changes to address wrong timeout computations >> in the `com.sun.jndi.dns.DnsClient`: >> - The `DnsClient` has been updated to use a monotonic high-resolution (nano) >> clock. The existing `Timeout` test ha

Re: RFR: 8339538: Wrong timeout computations in DnsClient [v11]

2024-10-07 Thread Daniel Fuchs
On Mon, 7 Oct 2024 09:00:28 GMT, Aleksei Efimov wrote: >> This PR proposes the following changes to address wrong timeout computations >> in the `com.sun.jndi.dns.DnsClient`: >> - The `DnsClient` has been updated to use a monotonic high-resolution (nano) >> clock. The existing `Timeout` test ha

Re: RFR: 8339538: Wrong timeout computations in DnsClient [v11]

2024-10-07 Thread Aleksei Efimov
> This PR proposes the following changes to address wrong timeout computations > in the `com.sun.jndi.dns.DnsClient`: > - The `DnsClient` has been updated to use a monotonic high-resolution (nano) > clock. The existing `Timeout` test has also been updated to use the nano > clock to measure obser

Re: RFR: 8339538: Wrong timeout computations in DnsClient [v9]

2024-10-04 Thread Aleksei Efimov
On Wed, 2 Oct 2024 13:38:17 GMT, Aleksei Efimov wrote: >> This PR proposes the following changes to address wrong timeout computations >> in the `com.sun.jndi.dns.DnsClient`: >> - The `DnsClient` has been updated to use a monotonic high-resolution (nano) >> clock. The existing `Timeout` test ha

Re: RFR: 8339538: Wrong timeout computations in DnsClient [v10]

2024-10-04 Thread Aleksei Efimov
> This PR proposes the following changes to address wrong timeout computations > in the `com.sun.jndi.dns.DnsClient`: > - The `DnsClient` has been updated to use a monotonic high-resolution (nano) > clock. The existing `Timeout` test has also been updated to use the nano > clock to measure obser

Re: RFR: 8339538: Wrong timeout computations in DnsClient [v8]

2024-10-02 Thread Mark Sheppard
On Wed, 2 Oct 2024 13:25:54 GMT, Aleksei Efimov wrote: > > I think that if there is a PortUnreachable thrown, during DnsClient.query > > processing from the doUdpQuery, then the timeout may expire early ... if > > I've interpreted the outer loop processing correctly > > The `DnsClient.query` m

Re: RFR: 8339538: Wrong timeout computations in DnsClient [v9]

2024-10-02 Thread Daniel Fuchs
On Wed, 2 Oct 2024 13:35:00 GMT, Aleksei Efimov wrote: >> This PR proposes the following changes to address wrong timeout computations >> in the `com.sun.jndi.dns.DnsClient`: >> - The `DnsClient` has been updated to use a monotonic high-resolution (nano) >> clock. The existing `Timeout` test ha

Re: RFR: 8339538: Wrong timeout computations in DnsClient [v9]

2024-10-02 Thread Aleksei Efimov
> This PR proposes the following changes to address wrong timeout computations > in the `com.sun.jndi.dns.DnsClient`: > - The `DnsClient` has been updated to use a monotonic high-resolution (nano) > clock. The existing `Timeout` test has also been updated to use the nano > clock to measure obser

Re: RFR: 8339538: Wrong timeout computations in DnsClient [v8]

2024-10-02 Thread Aleksei Efimov
On Mon, 30 Sep 2024 13:38:48 GMT, Daniel Fuchs wrote: >> Aleksei Efimov has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Track unfulfilled timeouts during UDP queries. >> Update exceptions handling. >> Update TCP client to use nano ti

Re: RFR: 8339538: Wrong timeout computations in DnsClient [v8]

2024-10-02 Thread Aleksei Efimov
On Mon, 30 Sep 2024 20:30:57 GMT, Mark Sheppard wrote: > I think that if there is a PortUnreachable thrown, during DnsClient.query > processing from the doUdpQuery, then the timeout may expire early ... if I've > interpreted the outer loop processing correctly The `DnsClient.query` marks serve

Re: RFR: 8339538: Wrong timeout computations in DnsClient [v8]

2024-09-30 Thread Mark Sheppard
On Thu, 19 Sep 2024 17:55:13 GMT, Aleksei Efimov wrote: >> This PR proposes the following changes to address wrong timeout computations >> in the `com.sun.jndi.dns.DnsClient`: >> - The `DnsClient` has been updated to use a monotonic high-resolution (nano) >> clock. The existing `Timeout` test h

Re: RFR: 8339538: Wrong timeout computations in DnsClient [v8]

2024-09-30 Thread Daniel Fuchs
On Thu, 19 Sep 2024 17:55:13 GMT, Aleksei Efimov wrote: >> This PR proposes the following changes to address wrong timeout computations >> in the `com.sun.jndi.dns.DnsClient`: >> - The `DnsClient` has been updated to use a monotonic high-resolution (nano) >> clock. The existing `Timeout` test h

Re: RFR: 8339538: Wrong timeout computations in DnsClient [v8]

2024-09-30 Thread Daniel Fuchs
On Thu, 19 Sep 2024 17:55:13 GMT, Aleksei Efimov wrote: >> This PR proposes the following changes to address wrong timeout computations >> in the `com.sun.jndi.dns.DnsClient`: >> - The `DnsClient` has been updated to use a monotonic high-resolution (nano) >> clock. The existing `Timeout` test h

Re: RFR: 8339538: Wrong timeout computations in DnsClient [v8]

2024-09-19 Thread Aleksei Efimov
> This PR proposes the following changes to address wrong timeout computations > in the `com.sun.jndi.dns.DnsClient`: > - The `DnsClient` has been updated to use a monotonic high-resolution (nano) > clock. The existing `Timeout` test has also been updated to use the nano > clock to measure obser

Re: RFR: 8339538: Wrong timeout computations in DnsClient [v5]

2024-09-19 Thread Aleksei Efimov
On Wed, 11 Sep 2024 16:27:29 GMT, Daniel Fuchs wrote: >> 2 time is not too high, >> I have presented, in the comment, a failures with the elapsed time is almost >> twice the expected time >> where the elapsed time is 14229 !! which is approx 1.84 * expected timeout > > @msheppar with the latest

Re: RFR: 8339538: Wrong timeout computations in DnsClient [v5]

2024-09-11 Thread Daniel Fuchs
On Tue, 10 Sep 2024 19:01:54 GMT, Mark Sheppard wrote: >> I agree that we don't want to document too much here. Updated the factor to >> 1.75 (2 seems a bit high and might hide real issues), and to make the >> timeout value calculation and check less arcane - I have updated test output >> to p

Re: RFR: 8339538: Wrong timeout computations in DnsClient [v7]

2024-09-11 Thread Daniel Fuchs
On Wed, 11 Sep 2024 15:22:43 GMT, Aleksei Efimov wrote: >> This PR proposes the following changes to address wrong timeout computations >> in the `com.sun.jndi.dns.DnsClient`: >> - The `DnsClient` has been updated to use a monotonic high-resolution (nano) >> clock. The existing `Timeout` test h

Re: RFR: 8339538: Wrong timeout computations in DnsClient [v5]

2024-09-11 Thread Aleksei Efimov
On Tue, 10 Sep 2024 19:01:54 GMT, Mark Sheppard wrote: >> I agree that we don't want to document too much here. Updated the factor to >> 1.75 (2 seems a bit high and might hide real issues), and to make the >> timeout value calculation and check less arcane - I have updated test output >> to p

Re: RFR: 8339538: Wrong timeout computations in DnsClient [v7]

2024-09-11 Thread Aleksei Efimov
> This PR proposes the following changes to address wrong timeout computations > in the `com.sun.jndi.dns.DnsClient`: > - The `DnsClient` has been updated to use a monotonic high-resolution (nano) > clock. The existing `Timeout` test has also been updated to use the nano > clock to measure obser

Re: RFR: 8339538: Wrong timeout computations in DnsClient [v6]

2024-09-11 Thread Daniel Fuchs
On Tue, 10 Sep 2024 18:41:41 GMT, Aleksei Efimov wrote: >> This PR proposes the following changes to address wrong timeout computations >> in the `com.sun.jndi.dns.DnsClient`: >> - The `DnsClient` has been updated to use a monotonic high-resolution (nano) >> clock. The existing `Timeout` test h

Re: RFR: 8339538: Wrong timeout computations in DnsClient [v5]

2024-09-10 Thread Mark Sheppard
On Tue, 10 Sep 2024 18:38:15 GMT, Aleksei Efimov wrote: >> I think 2 times is good, remove all potential noise ;-) >> >> the following failures is nearly twice the expected >> >> --System.out:(3/73)-- >> Skip local DNS Server creation >> Elapsed (ms): 14229 >> Expected (ms): 77

Re: RFR: 8339538: Wrong timeout computations in DnsClient [v5]

2024-09-10 Thread Aleksei Efimov
On Tue, 10 Sep 2024 14:47:26 GMT, Daniel Fuchs wrote: >> src/jdk.naming.dns/share/classes/com/sun/jndi/dns/DnsClient.java line 443: >> >>> 441: // integer overflow (timeout is an int). >>> 442: // no point in supporting timeout > Integer.MAX_VALUE, >>> clamp if n

Re: RFR: 8339538: Wrong timeout computations in DnsClient [v5]

2024-09-10 Thread Aleksei Efimov
On Tue, 10 Sep 2024 18:15:34 GMT, Mark Sheppard wrote: >> I don't think it is a rabbit hole, to provide some additional clarity on the >> timeout mechanism and to avoid any perception that it has absolute realtime >> timeout semantics, such that developers have precise view of how the >> mecha

Re: RFR: 8339538: Wrong timeout computations in DnsClient [v5]

2024-09-10 Thread Aleksei Efimov
On Tue, 10 Sep 2024 14:54:58 GMT, Daniel Fuchs wrote: >> Aleksei Efimov has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Measure time the caller spent waiting. Simplify timeoutLeft computation > > src/jdk.naming.dns/share/classes/com/sun/

Re: RFR: 8339538: Wrong timeout computations in DnsClient [v5]

2024-09-10 Thread Aleksei Efimov
On Tue, 10 Sep 2024 17:54:30 GMT, Mark Sheppard wrote: >> If I'm not mistaken here it's `Math.clamp(long, long, long)` which is >> called - because `timeout * (1L << retry)` is a long. We could make it more >> obvious by using `0L` instead of `0` too. > > thanks for the clarification ... yes i

Re: RFR: 8339538: Wrong timeout computations in DnsClient [v6]

2024-09-10 Thread Aleksei Efimov
> This PR proposes the following changes to address wrong timeout computations > in the `com.sun.jndi.dns.DnsClient`: > - The `DnsClient` has been updated to use a monotonic high-resolution (nano) > clock. The existing `Timeout` test has also been updated to use the nano > clock to measure obser

Re: RFR: 8339538: Wrong timeout computations in DnsClient [v5]

2024-09-10 Thread Mark Sheppard
On Tue, 10 Sep 2024 17:50:59 GMT, Mark Sheppard wrote: >> I don't think we want to go down the rabbit hole of documenting too much. >> Agreed that using a simple factor 2 would make the code simpler, but do we >> want to go that high? > > I don't think it is a rabbit hole, to provide some addit

Re: RFR: 8339538: Wrong timeout computations in DnsClient [v5]

2024-09-10 Thread Mark Sheppard
On Tue, 10 Sep 2024 14:44:35 GMT, Daniel Fuchs wrote: >> src/jdk.naming.dns/share/classes/com/sun/jndi/dns/DnsClient.java line 442: >> >>> 440: // use 1L below to ensure conversion to long and avoid >>> potential >>> 441: // integer overflow (timeout is an int).

Re: RFR: 8339538: Wrong timeout computations in DnsClient [v5]

2024-09-10 Thread Mark Sheppard
On Tue, 10 Sep 2024 14:59:44 GMT, Daniel Fuchs wrote: >> test/jdk/com/sun/jndi/dns/ConfigTests/Timeout.java line 112: >> >>> 110: // Check that elapsed time is as long as expected, and >>> 111: // not more than 67% greater. Given the min DNS timeout >>> 112: /

Re: RFR: 8339538: Wrong timeout computations in DnsClient [v5]

2024-09-10 Thread Daniel Fuchs
On Tue, 10 Sep 2024 09:49:08 GMT, Mark Sheppard wrote: >> Aleksei Efimov has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Measure time the caller spent waiting. Simplify timeoutLeft computation > > test/jdk/com/sun/jndi/dns/ConfigTests/Ti

Re: RFR: 8339538: Wrong timeout computations in DnsClient [v5]

2024-09-10 Thread Daniel Fuchs
On Mon, 9 Sep 2024 22:29:23 GMT, Aleksei Efimov wrote: >> This PR proposes the following changes to address wrong timeout computations >> in the `com.sun.jndi.dns.DnsClient`: >> - The `DnsClient` has been updated to use a monotonic high-resolution (nano) >> clock. The existing `Timeout` test ha

Re: RFR: 8339538: Wrong timeout computations in DnsClient [v5]

2024-09-10 Thread Daniel Fuchs
On Tue, 10 Sep 2024 08:39:15 GMT, Daniel Jeliński wrote: >> Aleksei Efimov has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Measure time the caller spent waiting. Simplify timeoutLeft computation > > src/jdk.naming.dns/share/classes/com/s

Re: RFR: 8339538: Wrong timeout computations in DnsClient [v5]

2024-09-10 Thread Daniel Fuchs
On Tue, 10 Sep 2024 09:38:35 GMT, Mark Sheppard wrote: >> Aleksei Efimov has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Measure time the caller spent waiting. Simplify timeoutLeft computation > > src/jdk.naming.dns/share/classes/com/sun

Re: RFR: 8339538: Wrong timeout computations in DnsClient [v5]

2024-09-10 Thread Mark Sheppard
On Mon, 9 Sep 2024 22:29:23 GMT, Aleksei Efimov wrote: >> This PR proposes the following changes to address wrong timeout computations >> in the `com.sun.jndi.dns.DnsClient`: >> - The `DnsClient` has been updated to use a monotonic high-resolution (nano) >> clock. The existing `Timeout` test ha

Re: RFR: 8339538: Wrong timeout computations in DnsClient [v5]

2024-09-10 Thread Mark Sheppard
On Mon, 9 Sep 2024 22:29:23 GMT, Aleksei Efimov wrote: >> This PR proposes the following changes to address wrong timeout computations >> in the `com.sun.jndi.dns.DnsClient`: >> - The `DnsClient` has been updated to use a monotonic high-resolution (nano) >> clock. The existing `Timeout` test ha

Re: RFR: 8339538: Wrong timeout computations in DnsClient [v5]

2024-09-10 Thread Daniel Jeliński
On Mon, 9 Sep 2024 22:29:23 GMT, Aleksei Efimov wrote: >> This PR proposes the following changes to address wrong timeout computations >> in the `com.sun.jndi.dns.DnsClient`: >> - The `DnsClient` has been updated to use a monotonic high-resolution (nano) >> clock. The existing `Timeout` test ha

Re: RFR: 8339538: Wrong timeout computations in DnsClient [v2]

2024-09-09 Thread Aleksei Efimov
On Mon, 9 Sep 2024 17:15:43 GMT, Aleksei Efimov wrote: >> I have been wondering why the timeout was measured in this way. My >> explanation was that the original author of the API (duke? ;-) ) wanted to >> measure "actual timeout" (time actually spent waiting for a packet) as >> opposed to per

Re: RFR: 8339538: Wrong timeout computations in DnsClient [v5]

2024-09-09 Thread Aleksei Efimov
> This PR proposes the following changes to address wrong timeout computations > in the `com.sun.jndi.dns.DnsClient`: > - The `DnsClient` has been updated to use a monotonic high-resolution (nano) > clock. The existing `Timeout` test has also been updated to use the nano > clock to measure obser

Re: RFR: 8339538: Wrong timeout computations in DnsClient [v2]

2024-09-09 Thread Aleksei Efimov
On Mon, 9 Sep 2024 15:03:46 GMT, Daniel Fuchs wrote: >> Sounds like a right thing to do: measuring time in the loop should give us >> better estimation on time DNS client spends waiting on the response after >> submiting a query (that's how environment property value is defined in >> [javadoc

Re: RFR: 8339538: Wrong timeout computations in DnsClient [v4]

2024-09-09 Thread Aleksei Efimov
> This PR proposes the following changes to address wrong timeout computations > in the `com.sun.jndi.dns.DnsClient`: > - The `DnsClient` has been updated to use a monotonic high-resolution (nano) > clock. The existing `Timeout` test has also been updated to use the nano > clock to measure obser

Re: RFR: 8339538: Wrong timeout computations in DnsClient [v3]

2024-09-09 Thread Aleksei Efimov
> This PR proposes the following changes to address wrong timeout computations > in the `com.sun.jndi.dns.DnsClient`: > - The `DnsClient` has been updated to use a monotonic high-resolution (nano) > clock. The existing `Timeout` test has also been updated to use the nano > clock to measure obser

Re: RFR: 8339538: Wrong timeout computations in DnsClient [v2]

2024-09-09 Thread Daniel Fuchs
On Mon, 9 Sep 2024 11:42:25 GMT, Aleksei Efimov wrote: >> This PR proposes the following changes to address wrong timeout computations >> in the `com.sun.jndi.dns.DnsClient`: >> - The `DnsClient` has been updated to use a monotonic high-resolution (nano) >> clock. The existing `Timeout` test ha

Re: RFR: 8339538: Wrong timeout computations in DnsClient [v2]

2024-09-09 Thread Daniel Fuchs
On Mon, 9 Sep 2024 14:42:41 GMT, Aleksei Efimov wrote: >> src/jdk.naming.dns/share/classes/com/sun/jndi/dns/DnsClient.java line 477: >> >>> 475: long elapsedMillis = >>> TimeUnit.NANOSECONDS.toMillis(end - start); >>> 476: // Setting the Math.clamp min to

Re: RFR: 8339538: Wrong timeout computations in DnsClient [v2]

2024-09-09 Thread Aleksei Efimov
On Mon, 9 Sep 2024 13:58:51 GMT, Daniel Jeliński wrote: >> Aleksei Efimov has updated the pull request incrementally with two >> additional commits since the last revision: >> >> - guard against possible integer value overflows >> - make startTime a local variable > > src/jdk.naming.dns/share

Re: RFR: 8339538: Wrong timeout computations in DnsClient [v2]

2024-09-09 Thread Daniel Jeliński
On Mon, 9 Sep 2024 11:42:25 GMT, Aleksei Efimov wrote: >> This PR proposes the following changes to address wrong timeout computations >> in the `com.sun.jndi.dns.DnsClient`: >> - The `DnsClient` has been updated to use a monotonic high-resolution (nano) >> clock. The existing `Timeout` test ha

Re: RFR: 8339538: Wrong timeout computations in DnsClient [v2]

2024-09-09 Thread Aleksei Efimov
On Fri, 6 Sep 2024 16:58:20 GMT, Daniel Fuchs wrote: >> Aleksei Efimov has updated the pull request incrementally with two >> additional commits since the last revision: >> >> - guard against possible integer value overflows >> - make startTime a local variable > > test/jdk/com/sun/jndi/dns/C

Re: RFR: 8339538: Wrong timeout computations in DnsClient [v2]

2024-09-09 Thread Aleksei Efimov
On Sat, 7 Sep 2024 13:12:23 GMT, Jaikiran Pai wrote: >> Aleksei Efimov has updated the pull request incrementally with two >> additional commits since the last revision: >> >> - guard against possible integer value overflows >> - make startTime a local variable > > src/jdk.naming.dns/share/cl

Re: RFR: 8339538: Wrong timeout computations in DnsClient [v2]

2024-09-09 Thread Aleksei Efimov
> This PR proposes the following changes to address wrong timeout computations > in the `com.sun.jndi.dns.DnsClient`: > - The `DnsClient` has been updated to use a monotonic high-resolution (nano) > clock. The existing `Timeout` test has also been updated to use the nano > clock to measure obser

Re: RFR: 8339538: Wrong timeout computations in DnsClient

2024-09-07 Thread Jaikiran Pai
On Fri, 6 Sep 2024 16:28:36 GMT, Aleksei Efimov wrote: > This PR proposes the following changes to address wrong timeout computations > in the `com.sun.jndi.dns.DnsClient`: > - The `DnsClient` has been updated to use a monotonic high-resolution (nano) > clock. The existing `Timeout` test has al

Re: RFR: 8339538: Wrong timeout computations in DnsClient

2024-09-06 Thread Daniel Fuchs
On Fri, 6 Sep 2024 16:28:36 GMT, Aleksei Efimov wrote: > This PR proposes the following changes to address wrong timeout computations > in the `com.sun.jndi.dns.DnsClient`: > - The `DnsClient` has been updated to use a monotonic high-resolution (nano) > clock. The existing `Timeout` test has al

RFR: 8339538: Wrong timeout computations in DnsClient

2024-09-06 Thread Aleksei Efimov
This PR proposes the following changes to address wrong timeout computations in the `com.sun.jndi.dns.DnsClient`: - The `DnsClient` has been updated to use a monotonic high-resolution (nano) clock. The existing `Timeout` test has also been updated to use the nano clock to measure observed timeou