Repository: helix Updated Branches: refs/heads/master 304a8f863 -> fe970550b
Fix race condition in Helix messaging service. Project: http://git-wip-us.apache.org/repos/asf/helix/repo Commit: http://git-wip-us.apache.org/repos/asf/helix/commit/cec3d446 Tree: http://git-wip-us.apache.org/repos/asf/helix/tree/cec3d446 Diff: http://git-wip-us.apache.org/repos/asf/helix/diff/cec3d446 Branch: refs/heads/master Commit: cec3d4466ec42cc6b589edbf49546f6f3a49a39f Parents: 304a8f8 Author: Lei Xia <[email protected]> Authored: Mon Jun 4 14:14:41 2018 -0700 Committer: Junkai Xue <[email protected]> Committed: Thu Jul 12 16:52:58 2018 -0700 ---------------------------------------------------------------------- .../java/org/apache/helix/messaging/DefaultMessagingService.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/helix/blob/cec3d446/helix-core/src/main/java/org/apache/helix/messaging/DefaultMessagingService.java ---------------------------------------------------------------------- diff --git a/helix-core/src/main/java/org/apache/helix/messaging/DefaultMessagingService.java b/helix-core/src/main/java/org/apache/helix/messaging/DefaultMessagingService.java index fb84fd7..e725a8e 100644 --- a/helix-core/src/main/java/org/apache/helix/messaging/DefaultMessagingService.java +++ b/helix-core/src/main/java/org/apache/helix/messaging/DefaultMessagingService.java @@ -321,8 +321,8 @@ public class DefaultMessagingService implements ClusterMessagingService { int timeOut, int retryCount) { int messagesSent = send(receipientCriteria, message, asyncCallback, timeOut, retryCount); if (messagesSent > 0) { - while (!asyncCallback.isDone() && !asyncCallback.isTimedOut()) { - synchronized (asyncCallback) { + synchronized (asyncCallback) { + while (!asyncCallback.isDone() && !asyncCallback.isTimedOut()) { try { asyncCallback.wait(); } catch (InterruptedException e) {
