Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-15867

Socket shutdown called twice in GridNioServer

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.11
    • 2.13
    • networking
    • Fixed logging non-informative ClosedChannelException
    • Release Notes Required

    Description

      After fixing IGNITE-15367 calling GridNioServer$AbstractNioClientWorker.closekey(SelectionKey key) would produce excessive java.nio.channels.ClosedChannelException because sock.shutdownInput() and sock.shutdownInput() would be called twice:

      // GridNioServer$AbstractNioClientWorker
      
      private void closeKey(SelectionKey key) {
          // Shutdown input and output so that remote client will see correct socket close.
          Socket sock = ((SocketChannel)key.channel()).socket();
      
          try {
              try {
                  sock.shutdownInput();           // <-- First time
              }
              catch (IOException ignored) {
                  // No-op.
              }
      
              try {
                  sock.shutdownOutput();          // <-- First time
              }
              catch (IOException ignored) {
                  // No-op.
              }
          }
          finally {
              U.close(key, log);                  // <-- Second time
              U.close(sock, log);                 // <-- Second time
          }
      }
      

      Attachments

        Issue Links

          Activity

            People

              rpuch Roman Puchkovskiy
              Korol Ilya Korol
              Sergey Chugunov Sergey Chugunov
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 0.5h
                  0.5h