Details

    • Sub-task
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 2.9
    • None

    Description

      Backward node connection checking looks wierd. What we might improve are:

      1) Addresses checking could be done in parrallel, not sequentially.

      for (InetSocketAddress addr : nodeAddrs) {
          // Connection refused may be got if node doesn't listen
          // (or blocked by firewall, but anyway assume it is dead).
          if (!isConnectionRefused(addr)) {
              liveAddr = addr;
      
              break;
              }
      }
      

      2) Any io-exception should be considered as failed connection, not only connection-refused:

      catch (ConnectException e) {
          return true;
      }
      catch (IOException e) {
          return false;
      }
      

      3) Timeout on connection checking should not be constant or hardcode:

      sock.connect(addr, 100);
      

      4) Decision to check connection should rely on configured exchange timeout, no on the ping interval

      // We got message from previous in less than double connection check interval.
      boolean ok = rcvdTime + U.millisToNanos(connCheckInterval) * 2 >= now;
      

      Attachments

        Issue Links

          Activity

            People

              vladsz83 Vladimir Steshin
              vladsz83 Vladimir Steshin
              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 - 20m
                  20m