ritegarg commented on PR #2547: URL: https://github.com/apache/phoenix/pull/2547#issuecomment-4889541278
> Thanks, this lgtm. > > I had the robot look at it also and it gave this reasonable suggestion, but I think it is minor > > Tighten the fail-closed check in `getCurrentPeerRecord`: There is a small TOCTOU: `isBlind()` reads the volatile visibility outside `stateLock`. A concurrent `setBlind()` from the Curator event thread could flip visibility between the check and entering `synchronized (stateLock)`, at which point we return the (now-stale) cache. Thanks for the review and the approval! Good call on the robot's suggestion — tightened it in 3771d223: the isBlind() guard now sits inside synchronized (stateLock), and since setBlind() flips visibility under that same lock, a concurrent blind transition can no longer slip between the check and the cache read. No other behavior change; HAGroupStoreClientIT (53) still green. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
