File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
src/main/java/com/github/shyiko/mysql/binlog Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -610,6 +610,7 @@ private void confirmSupportOfChecksum(ChecksumType checksumType) throws IOExcept
610610
611611 private void listenForEventPackets () throws IOException {
612612 ByteArrayInputStream inputStream = channel .getInputStream ();
613+ boolean completeShutdown = false ;
613614 try {
614615 while (inputStream .peek () != -1 ) {
615616 int packetLength = inputStream .readInteger (3 );
@@ -621,6 +622,7 @@ private void listenForEventPackets() throws IOException {
621622 errorPacket .getSqlState ());
622623 }
623624 if (marker == (byte ) 0xFE && !blocking ) {
625+ completeShutdown = true ;
624626 break ;
625627 }
626628 Event event ;
@@ -658,7 +660,11 @@ private void listenForEventPackets() throws IOException {
658660 }
659661 } finally {
660662 if (isConnected ()) {
661- disconnectChannel ();
663+ if (completeShutdown ) {
664+ disconnect (); // initiate complete shutdown sequence (which includes keep alive thread)
665+ } else {
666+ disconnectChannel ();
667+ }
662668 }
663669 }
664670 }
You can’t perform that action at this time.
0 commit comments