NIO Socket.read() may not respect the socket timeout

Alexei Olkhovskii alexei.olkhovskii at servicenow.com
Wed May 28 19:46:57 UTC 2025


> This may be an issue with the reserved stack area. There was work done in JDK 9 via JEP 270 [1] but I think it needs to be looked at again.

Perhaps https://bugs.openjdk.org/browse/JDK-8318888 is also relevant.
But regardless of the reason the other thread is holding the lock, don’t you think the socket timeout should be respected for read(), connect(), etc?

--
Regards, Alexei

From: Alan Bateman <alan.bateman at oracle.com>
Date: Wednesday, May 28, 2025 at 12:05
To: Alexei Olkhovskii <alexei.olkhovskii at servicenow.com>, nio-dev at openjdk.org <nio-dev at openjdk.org>
Subject: Re: NIO Socket.read() may not respect the socket timeout
[External Email]

________________________________
On 28/05/2025 18:56, Alexei Olkhovskii wrote:

Hi Alan, thanks for response

> Would it be possible to do some digging to say for sure if this happens after StackOverflowError (SOE)?

We saw a thread throwing an SOE while holding a DB connection. Later, there was another thread getting stuck while trying to cleanup a connection.

This may be an issue with the reserved stack area. There was work done in JDK 9 via JEP 270 [1] but I think it needs to be looked at again.

-Alan

[1] https://openjdk.org/jeps/270<https://openjdk.org/jeps/270>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/nio-dev/attachments/20250528/89aa5827/attachment-0001.htm>


More information about the nio-dev mailing list