virajjasani commented on code in PR #5445:
URL: https://github.com/apache/hadoop/pull/5445#discussion_r1123555498
##########
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/ErrorReportAction.java:
##########
@@ -34,7 +34,8 @@ public class ErrorReportAction implements
BPServiceActorAction {
final int errorCode;
final String errorMessage;
-
+ private boolean isReportSuccessfullySent = false;
Review Comment:
Sure, we can keep it volatile to be a bit more aggressive. However,
regardless of whichever thread calls `isReportSuccessfullySent`, the eventual
value would come as true if the action was completed, and the nature of the
utility method is to wait for it to be true so we should be good IMO. In fact,
the thread that calls it is definitely other thread only (main thread of the
test, in this case).
On the other hand, if we were to have a utility that needs strong
consistency for the value returned by `isReportSuccessfullySent` and not have
any retry/wait sort of mechanism in place, then yes volatile would be the right
choice.
Does it sound good?
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]