spacemonkd commented on code in PR #10426:
URL: https://github.com/apache/ozone/pull/10426#discussion_r3450319800
##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/DataNodeMetricsService.java:
##########
@@ -74,6 +75,7 @@ public class DataNodeMetricsService {
private final AtomicBoolean isRunning = new AtomicBoolean(false);
private MetricCollectionStatus currentStatus =
MetricCollectionStatus.NOT_STARTED;
+ private String failedMessage = "Metrics collection task failed. Please retry
after some time.";
Review Comment:
But scenario is like:
- Thread A (async `collectMetrics`) writes `failedMessage =
e.getLocalizedMessage()` at line 165
- Thread B (request thread) reads `failedMessage` at line 327 via
`getCollectedMetrics()`
It seems on ARM (which Ozone supports), Thread B could read a stale or
partially-constructed value.
We could try making `failedMessage` volatile.
--
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]