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
--- 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;