Possible bug in jdk.naming.dns. I need guidance on how get someone smarter to look at it.

Marko Bakšić Marko.Baksic at infobip.com
Thu Sep 5 05:23:48 UTC 2024


Awesome, thank you guys.

-- Marko



[cid:Infobip_logo_vertical_signature_e28e13d2-255b-4571-a70c-8292f2d75c0b.png]

Marko Bakšić

Software Engineer


E Marko.Baksic at infobip.com

M


A Utinjska 29A, 10000 Zagreb, Croatia

www.infobip.com<http://www.infobip.com>







________________________________
From: Aleksei Efimov <aleksej.efimov at oracle.com>
Sent: Wednesday, September 4, 2024 17:29
To: Daniel FUCHS <daniel.fuchs at oracle.com>; Marko Bakšić <Marko.Baksic at infobip.com>; core-libs-dev <core-libs-dev at openjdk.org>
Subject: [EXTERNAL] Re: Possible bug in jdk.naming.dns. I need guidance on how get someone smarter to look at it.

Thank you, Marko - it's an excellent catch! Indeed, we have a bug in a code that updates the left timeout. And yes, we should use nanoTime for measuring elapsed time. I will work on a fix for both issues and will try to create a test for the left timeout update scenario.

- Aleksei
________________________________
From: core-libs-dev <core-libs-dev-retn at openjdk.org> on behalf of Daniel Fuchs <daniel.fuchs at oracle.com>
Sent: 04 September 2024 3:59 PM
To: Marko Bakšić <Marko.Baksic at infobip.com>; core-libs-dev <core-libs-dev at openjdk.org>
Subject: Re: Possible bug in jdk.naming.dns. I need guidance on how get someone smarter to look at it.

On 04/09/2024 15:02, Marko Bakšić wrote:
> Thank you Daniel.
>
> The part that was suspicious to me is
>
> ```
> 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).

Indeed - good observation!

-- daniel


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/core-libs-dev/attachments/20240905/230a9d3f/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/png
Size: 2551 bytes
Desc: Infobip_logo_vertical_signature_e28e13d2-255b-4571-a70c-8292f2d75c0b.png
URL: <https://mail.openjdk.org/pipermail/core-libs-dev/attachments/20240905/230a9d3f/attachment-0001.png>


More information about the core-libs-dev mailing list