Uploaded image for project: 'JGroups'
  1. JGroups
  2. JGRP-2992

TCP.enable_suspect_events caused regression

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 5.5.4
    • None
    • None
    • False
    • Hide

      None

      Show
      None
    • False

      To reproduce:

      • Run 2 Chat instances
      • Config is stock tcp.xml, with FD_SOCK2 removed and TCP.enable_suspect_events=true
      • Kill the second instance
        -> The first instance will not get a new view until FD_ALL3 kicks in ca 40s later

      The cause is in TcpConnection:

      
       @Override
          public void close(boolean graceful) throws IOException {
              if(graceful && !closed_gracefully)
                  closeGracefully();
              doClose();
          }
      
       protected void closeGracefully() {
              server.log.trace("%s: sending graceful close to %s", server.local_addr, peer_addr);
              closed_gracefully=true;
              try {
                  sock.shutdownInput();
                  out.writeInt(Connection.GRACEFUL_CLOSE);
                  out.flush();
                  sock.shutdownOutput();
              }
              catch(Throwable t) {
                  server.log.error("%s: failed sending graceful close to %s: %s", server.local_addr, peer_addr, t.getMessage());
              }
          }
      

      Setting closed_gracefully to true causes the issue. The correct code should be:

         @Override
          public void close(boolean graceful) throws IOException {
              if(graceful && !closed_gracefully && !isClosed())
                  closeGracefully();
              doClose();
          }
      
          protected void closeGracefully() {
              server.log.trace("%s: sending graceful close to %s", server.local_addr, peer_addr);
              // closed_gracefully=true;
              try {
                  sock.shutdownInput();
                  out.writeInt(Connection.GRACEFUL_CLOSE);
                  out.flush();
                  sock.shutdownOutput();
              }
              catch(Throwable t) {
                  server.log.error("%s: failed sending graceful close to %s: %s", server.local_addr, peer_addr, t.getMessage());
              }
          }
      

      Check why this was not caught in the EnableSuspectEvent tests

              rhn-engineering-bban Bela Ban
              rhn-engineering-bban Bela Ban
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: