OpenJDK / jdk / jdk
changeset 45123:e0a225dbc346
8180085: (ch) java/nio/channels/SocketChannel/VectorIO.java: add debug instrumentation
Summary: Add some print statements potentially useful in solving JDK-8177801.
Reviewed-by: alanb
author | bpb |
---|---|
date | Thu, 11 May 2017 07:43:36 -0700 |
parents | 8cfb711b103b |
children | 144479e89cdb |
files | jdk/test/java/nio/channels/SocketChannel/VectorIO.java |
diffstat | 1 files changed, 12 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/jdk/test/java/nio/channels/SocketChannel/VectorIO.java Thu May 11 15:05:32 2017 +0100 +++ b/jdk/test/java/nio/channels/SocketChannel/VectorIO.java Thu May 11 07:43:36 2017 -0700 @@ -87,8 +87,11 @@ while (rem > 0L) { long bytesWritten = sc.write(bufs); if (bytesWritten == 0) { - if (sc.isBlocking()) + if (sc.isBlocking()) { throw new RuntimeException("write did not block"); + } else { + System.err.println("Non-blocking write() wrote zero bytes"); + } Thread.sleep(50); } else { rem -= bytesWritten; @@ -140,8 +143,10 @@ for (;;) { sc = ssc.accept(); - if (sc != null) + if (sc != null) { + System.err.println("accept() succeeded"); break; + } Thread.sleep(50); } @@ -154,8 +159,12 @@ if (bytesRead < 0) break; if (bytesRead == 0) { - if (sc.isBlocking()) + if (sc.isBlocking()) { throw new RuntimeException("read did not block"); + } else { + System.err.println + ("Non-blocking read() read zero bytes"); + } Thread.sleep(50); } avail -= bytesRead;