changeset 17129:4e2a2733855d

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 f895e36ce0e9
children c17e1662bad1
files test/java/nio/channels/SocketChannel/VectorIO.java
diffstat 1 files changed, 12 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/test/java/nio/channels/SocketChannel/VectorIO.java	Thu May 11 15:05:32 2017 +0100
+++ b/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;