Possible network issue

Robert Engels rengels at ix.netcom.com
Tue Nov 7 12:51:54 UTC 2023


This is under x64. 

I read through the issue - the distinction here is that this is with TCP not UDP, so a socket exception is not recoverable - the stream is in a indeterminate state. 

Reading the posix specification it certainly seems that when writing using NONBLOCK this error should be expected and handled. 

I am not reconfiguring any network settings nor changing the socket settings from their defaults. 

My guess is that OSX handles this according to spec and when using local sockets you can exhaust the network buffers with slow readers. 

I can’t comment on the openjdk issue. This is 100% reproducible for me. 



> On Nov 7, 2023, at 1:43 AM, Alan Bateman <Alan.Bateman at oracle.com> wrote:
> 
> On 07/11/2023 06:32, robert engels wrote:
>> Hi,
>> 
>> I would ordinarily send this to the net list, but I think this code was changed to support VT - using Nio behind the scenes for socket writes.
>> 
>> Essentially, I am receiving the following exception under heavy load (exhausting the kernel network buffers):
>> 
>> java.net.SocketException: No buffer space available
>>         at java.base/sun.nio.ch.SocketDispatcher.write0(Native Method)
>>         at java.base/sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:62)
>>         at java.base/sun.nio.ch.NioSocketImpl.tryWrite(NioSocketImpl.java:394)
>>         at java.base/sun.nio.ch.NioSocketImpl.implWrite(NioSocketImpl.java:410)
>>         at java.base/sun.nio.ch.NioSocketImpl.write(NioSocketImpl.java:440)
>>         at java.base/sun.nio.ch.NioSocketImpl$2.write(NioSocketImpl.java:819)
>>         at java.base/java.net.Socket$SocketOutputStream.write(Socket.java:1195)
>>         at robaho.net.httpserver.HttpConnection$ActivityTimerOutputStream.write(HttpConnection.java:189)
> 
> Is this macos-aarch64? I don't think we've seen this with virtual threads but there are dozen or more issues in JBS on this same issue where is happens elsewhere, JDK-8273158 [1] is one example. A lot of data has been collected but I don't think there is a conclusion yet on whether this resource exhaustion issue is real or not. At one point I thought we were close enough to having enough to report a bug to Apple or ask for tuning advice.
> 
> -Alan
> 
> [1] https://bugs.openjdk.org/browse/JDK-8273158


More information about the loom-dev mailing list