Browse Source

fixed more info

七锋 6 years ago
parent
commit
8597d9e926

+ 5 - 4
driver/src/main/java/com/alibaba/otter/canal/parse/driver/mysql/socket/BioSocketChannel.java

@@ -88,8 +88,9 @@ public class BioSocketChannel implements SocketChannel {
             }
         }
         if (remain > 0 && accTimeout >= timeout) {
-            throw new SocketTimeoutException("Timeout occurred, failed to read " + readSize + " bytes in " + timeout
-                                             + " milliseconds.");
+            throw new SocketTimeoutException("Timeout occurred, failed to read total " + readSize + " bytes in "
+                                             + timeout + " milliseconds, actual read only " + (readSize - remain)
+                                             + " bytes");
         }
         return data;
     }
@@ -120,8 +121,8 @@ public class BioSocketChannel implements SocketChannel {
         }
 
         if (n < len && accTimeout >= timeout) {
-            throw new SocketTimeoutException("Timeout occurred, failed to read " + len + " bytes in " + timeout
-                                             + " milliseconds.");
+            throw new SocketTimeoutException("Timeout occurred, failed to read total " + len + " bytes in " + timeout
+                                             + " milliseconds, actual read only " + n + " bytes");
         }
     }