VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Sub-task
    • Status: Resolved
    • Priority: Minor
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: 3.5.0
    • Component/s: None
    • Labels:
      None

      Description

      findbugs is complaining

       if (sessionsById.get(id) == null) {
                   SessionImpl s = new SessionImpl(id, sessionTimeout);
                   sessionsById.put(id, s);
      }
      

      is not atomic for the gap between get() and put().

      I suggest using putIfAbsent() instead.

        Attachments

        1. ZOOKEEPER-1978.patch
          1 kB
          Hongchao Deng

        Issue Links

          Activity

            People

            • Assignee:
              hdeng Hongchao Deng
              Reporter:
              hdeng Hongchao Deng

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment