[
https://issues.apache.org/jira/browse/HBASE-20597?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16490751#comment-16490751
]
Sean Busbey commented on HBASE-20597:
-------------------------------------
here's a potential addendum that ensures safe retrieval / update via an
AtomicReference and removes the {{synchronized}} from {{setRegionServers}}.
Some of the other locking in the {{HBaseReplicationEndpoint}} still looks
confusing to me (e.g. getPeerUUID), but it doesn't look unsafe so I left it
alone.
this patch clears findbugs locally ( {{mvn test-compile findbugs:check
-DskipTests=true}} ). I'm getting some test failures when I use {{mvn
-Psite-install-step install && mvn test -Dtest=*Replication*}}. Looking to
chase them down, but I also get failures when I don't have this addendum in
place so I'm not sure yet what's environment, flaky, or a problem with my
approach.
> Use a lock to serialize access to a shared reference to ZooKeeperWatcher in
> HBaseReplicationEndpoint
> ----------------------------------------------------------------------------------------------------
>
> Key: HBASE-20597
> URL: https://issues.apache.org/jira/browse/HBASE-20597
> Project: HBase
> Issue Type: Bug
> Components: Replication
> Affects Versions: 1.3.2, 1.4.4
> Reporter: Andrew Purtell
> Assignee: Andrew Purtell
> Priority: Minor
> Fix For: 3.0.0, 2.1.0, 1.5.0, 1.3.3, 2.0.1, 1.4.5
>
> Attachments: HBASE-20597-branch-1.patch,
> HBASE-20597.addendum.0.patch, HBASE-20597.patch
>
>
> The code that closes down a ZKW that fails to initialize when attempting to
> connect to the remote cluster is not MT safe and can in theory leak
> ZooKeeperWatcher instances. The allocation of a new ZKW and store to the
> reference is not atomic. Might have concurrent allocations with only one
> winning store, leading to leaked ZKW instances.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)