Uploaded image for project: 'Cassandra'
  1. Cassandra
  2. CASSANDRA-828

possible NPE in StorageService

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Low
    • Resolution: Fixed
    • 0.6
    • None
    • None
    • Low

    Description

      the code
      {{{

      if (endPointThatLeft.equals(FBUtilities.getLocalAddress()))

      { logger_.info("Received removeToken gossip about myself. Is this node a replacement for a removed one?"); return; }

      if (logger_.isDebugEnabled())
      logger_.debug("Token " + token + " removed manually (endpoint was " + ((endPointThatLeft == null) ? "unknown" : endPointThatLeft) + ")");
      if (endPointThatLeft != null)

      { removeEndPointLocally(endPointThatLeft); }

      }}}

      appears wrong: if it is possible for the leaving endpoint to be unknown then the first "if" has a possible null dereference, which can be eliminated by swapping the arguments or reordering the code.

      As a side note, I believe FBUtilities.getLocalAddress should probably be synchronized (or localInetAddress made volatile) per the usual "the java MM does not guarantee any change will ever be visible" mantra which may or may not be considered relevant

      Attachments

        Activity

          People

            riffraff gabriele renzi
            riffraff gabriele renzi
            gabriele renzi
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 5m
                5m
                Remaining:
                Remaining Estimate - 5m
                5m
                Logged:
                Time Spent - Not Specified
                Not Specified