JDK-8265367 : [macos-aarch64] 3 java/net/httpclient/websocket tests fail with "IOException: No buffer space available"
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.net
  • Affected Version: 17
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: os_x
  • CPU: aarch64
  • Submitted: 2021-04-16
  • Updated: 2021-10-08
  • Resolved: 2021-05-28
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 17
17 b25Fixed
Related Reports
Relates :  
Relates :  
Sub Tasks
JDK-8265368 :  
Description
The following tests failed in the JDK17 CI on macos-aarch46:

java/net/httpclient/websocket/PendingBinaryPongClose.java
java/net/httpclient/websocket/PendingBinaryPingClose.java
java/net/httpclient/websocket/PendingPongBinaryClose.java

Here's a log file snippet from PendingBinaryPongClose.java:

DEBUG: [HttpClient-2-SelectorManager] [25s 573ms] SelectorAttachment Registering jdk.internal.net.http.SocketTube$InternalWriteSubscriber$WriteEvent@46af4dd3 for 0 (false)
DEBUG: [HttpClient-2-SelectorManager] [25s 573ms] SocketTube(2) channel is writable
DEBUG: [HttpClient-2-SelectorManager] [25s 573ms] SocketTube(2) trying to write: 562
DEBUG: [HttpClient-2-SelectorManager] [25s 573ms] SocketTube(2) write error: java.io.IOException: No buffer space available
DEBUG: [HttpClient-2-SelectorManager] [25s 573ms] SocketTube(2) error signalled java.io.IOException: No buffer space available
DEBUG: [HttpClient-2-SelectorManager] [25s 573ms] SocketTube(2) pausing read event
DEBUG: [HttpClient-2-SelectorManager] [25s 573ms] SelectorAttachment Registering jdk.internal.net.http.SocketTube$InternalReadPublisher$ReadEvent@12d89d80 for 0 (false)
DEBUG: [HttpClient-2-SelectorManager] [25s 573ms] SocketTube(2) Sending error java.io.IOException: No buffer space available to subscriber jdk.internal.net.http.RawChannelTube$ReadSubscriber@431e8783
DEBUG: [HttpClient-2-SelectorManager] [25s 573ms] SocketTube(2) forwarding error to subscriber: java.io.IOException: No buffer space available
DEBUG: [HttpClient-2-SelectorManager] [25s 573ms] [WebSocket] RawChannelTube(SocketTube(2)) ReadSubscriber::onError java.io.IOException: No buffer space available
java.io.IOException: No buffer space available
	at java.base/sun.nio.ch.FileDispatcherImpl.writev0(Native Method)
	at java.base/sun.nio.ch.SocketDispatcher.writev(SocketDispatcher.java:66)
	at java.base/sun.nio.ch.IOUtil.write(IOUtil.java:182)
	at java.base/sun.nio.ch.IOUtil.write(IOUtil.java:130)
	at java.base/sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:563)
	at java.base/java.nio.channels.SocketChannel.write(SocketChannel.java:642)
	at java.net.http/jdk.internal.net.http.SocketTube.writeAvailable(SocketTube.java:1228)
	at java.net.http/jdk.internal.net.http.SocketTube$InternalWriteSubscriber.tryFlushCurrent(SocketTube.java:342)
	at java.net.http/jdk.internal.net.http.SocketTube$InternalWriteSubscriber.signalWritable(SocketTube.java:415)
	at java.net.http/jdk.internal.net.http.SocketTube$InternalWriteSubscriber$WriteEvent.signalEvent(SocketTube.java:442)
	at java.net.http/jdk.internal.net.http.SocketTube$SocketFlowEvent.handle(SocketTube.java:245)
	at java.net.http/jdk.internal.net.http.HttpClientImpl$SelectorManager.handleEvent(HttpClientImpl.java:975)
	at java.net.http/jdk.internal.net.http.HttpClientImpl$SelectorManager.lambda$run$3(HttpClientImpl.java:930)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
	at java.net.http/jdk.internal.net.http.HttpClientImpl$SelectorManager.run(HttpClientImpl.java:930)


Here's a log file snippet from PendingBinaryPingClose.java:

DEBUG: [HttpClient-2-SelectorManager] [25s 695ms] SelectorAttachment Registering jdk.internal.net.http.SocketTube$InternalWriteSubscriber$WriteEvent@4e675a34 for 0 (false)
DEBUG: [HttpClient-2-SelectorManager] [25s 695ms] SocketTube(2) channel is writable
DEBUG: [HttpClient-2-SelectorManager] [25s 695ms] SocketTube(2) trying to write: 562
DEBUG: [HttpClient-2-SelectorManager] [25s 696ms] SocketTube(2) write error: java.io.IOException: No buffer space available
DEBUG: [HttpClient-2-SelectorManager] [25s 696ms] SocketTube(2) error signalled java.io.IOException: No buffer space available
DEBUG: [HttpClient-2-SelectorManager] [25s 696ms] SocketTube(2) pausing read event
DEBUG: [HttpClient-2-SelectorManager] [25s 696ms] SelectorAttachment Registering jdk.internal.net.http.SocketTube$InternalReadPublisher$ReadEvent@5de107c9 for 0 (false)
DEBUG: [HttpClient-2-SelectorManager] [25s 696ms] SocketTube(2) Sending error java.io.IOException: No buffer space available to subscriber jdk.internal.net.http.RawChannelTube$ReadSubscriber@256f509f
DEBUG: [HttpClient-2-SelectorManager] [25s 696ms] SocketTube(2) forwarding error to subscriber: java.io.IOException: No buffer space available
DEBUG: [HttpClient-2-SelectorManager] [25s 696ms] [WebSocket] RawChannelTube(SocketTube(2)) ReadSubscriber::onError java.io.IOException: No buffer space available
java.io.IOException: No buffer space available
	at java.base/sun.nio.ch.FileDispatcherImpl.writev0(Native Method)
	at java.base/sun.nio.ch.SocketDispatcher.writev(SocketDispatcher.java:66)
	at java.base/sun.nio.ch.IOUtil.write(IOUtil.java:182)
	at java.base/sun.nio.ch.IOUtil.write(IOUtil.java:130)
	at java.base/sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:563)
	at java.base/java.nio.channels.SocketChannel.write(SocketChannel.java:642)
	at java.net.http/jdk.internal.net.http.SocketTube.writeAvailable(SocketTube.java:1228)
	at java.net.http/jdk.internal.net.http.SocketTube$InternalWriteSubscriber.tryFlushCurrent(SocketTube.java:342)
	at java.net.http/jdk.internal.net.http.SocketTube$InternalWriteSubscriber.signalWritable(SocketTube.java:415)
	at java.net.http/jdk.internal.net.http.SocketTube$InternalWriteSubscriber$WriteEvent.signalEvent(SocketTube.java:442)
	at java.net.http/jdk.internal.net.http.SocketTube$SocketFlowEvent.handle(SocketTube.java:245)
	at java.net.http/jdk.internal.net.http.HttpClientImpl$SelectorManager.handleEvent(HttpClientImpl.java:975)
	at java.net.http/jdk.internal.net.http.HttpClientImpl$SelectorManager.lambda$run$3(HttpClientImpl.java:930)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
	at java.net.http/jdk.internal.net.http.HttpClientImpl$SelectorManager.run(HttpClientImpl.java:930)


Here's a log file snippet from PendingPongBinaryClose.java:

result: Error. Agent communication error: java.net.SocketException: No buffer space available; check console log for any additional details

Please note that this "No buffer space available" appears to
have come from a JTREG agent, but I'm not sure about that.
Comments
11u notice See my comments in JDK-8268714 why I dropped this backport.
08-10-2021

Changeset: 24bf35f8 Author: Daniel Fuchs <dfuchs@openjdk.org> Date: 2021-05-28 14:21:11 +0000 URL: https://git.openjdk.java.net/jdk/commit/24bf35f862e285eeca662b9829901c0f91d247d5
28-05-2021

Assigning to [~dfuchs] for now. Please re-assign as appropriate.
23-04-2021