Skip to content

Commit

Permalink
HDFS-16898. Make write lock fine-grain in method processCommandFromActor
Browse files Browse the repository at this point in the history
  • Loading branch information
admin authored and admin committed Jan 29, 2023
1 parent 952d707 commit 75f1c4c
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -679,15 +679,20 @@ boolean processCommandFromActor(DatanodeCommand cmd,
actor.reRegister();
return false;
}
boolean isActiveActor;
writeLock();
try {
isActiveActor = actor == bpServiceToActive;
} finally {
writeUnlock();
}
try {
if (actor == bpServiceToActive) {
return processCommandFromActive(cmd, actor);
} else {
return processCommandFromStandby(cmd, actor);
}
} finally {
writeUnlock();
}
}

Expand Down

0 comments on commit 75f1c4c

Please sign in to comment.