Branch: refs/heads/master
  Home:   https://github.com/jenkinsci/jenkins
  Commit: aea48a9d7bb24df94d5de61a5dd39eda3dd028bd
      
https://github.com/jenkinsci/jenkins/commit/aea48a9d7bb24df94d5de61a5dd39eda3dd028bd
  Author: David Hoover <dhoo...@google.com>
  Date:   2015-04-19 (Sun, 19 Apr 2015)

  Changed paths:
    M core/src/main/java/hudson/util/ConsistentHash.java
    M core/src/test/java/hudson/util/ConsistentHashTest.java

  Log Message:
  -----------
  Synchronize all appropriate methods in ConsistentHash.

Only add(T, int) was synchronized (and its javadoc claimed it was the
only one modifying .items), but all the bulk add methods were going
straight to addInternal() and then refreshTable() on their own. Then
countAllPoints() was iterating over items.values() which has undefined
behavior if the underlying Map changed.

Technically I didn't need to synchronize the current implementations of
remove(T) and add(T) since they delegated fully to add(T, int), but
that's leaking implementation details and inviting trouble down the road
when someone doesn't realize that.

Likewise, addInternal() and refreshTable() need not be synchronized
since they're only ever called from already synchronized methods, but
I'm inclined to go for belt & suspenders in the wake of these other
issues.


  Commit: 57255ccb10546f4ed8bfda1cf30ba0e99d762acd
      
https://github.com/jenkinsci/jenkins/commit/57255ccb10546f4ed8bfda1cf30ba0e99d762acd
  Author: David Hoover <dhoo...@google.com>
  Date:   2015-04-19 (Sun, 19 Apr 2015)

  Changed paths:
    M core/src/main/java/hudson/util/ConsistentHash.java
    M core/src/test/java/hudson/util/ConsistentHashTest.java

  Log Message:
  -----------
  Clean up some generics in ConsistentHash and add tests for non-defaults.


  Commit: e4458fbe301df84e07cedbd4fcf0081ee8e5a10f
      
https://github.com/jenkinsci/jenkins/commit/e4458fbe301df84e07cedbd4fcf0081ee8e5a10f
  Author: Kohsuke Kawaguchi <k...@kohsuke.org>
  Date:   2015-04-29 (Wed, 29 Apr 2015)

  Changed paths:
    M core/src/main/java/hudson/util/ConsistentHash.java
    M core/src/test/java/hudson/util/ConsistentHashTest.java

  Log Message:
  -----------
  Merge pull request #1660 from deadmoose/really_sync

Fix concurrency issues in ConsistentHash


Compare: 
https://github.com/jenkinsci/jenkins/compare/e75bea8928a9...e4458fbe301d

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Commits" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-commits+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to