spacemonkd commented on code in PR #10426:
URL: https://github.com/apache/ozone/pull/10426#discussion_r3450134040


##########
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:
   A suggestion from AI was that this is written from the async 
`collectMetrics` thread and read from the request thread in 
`getCollectedMetrics` - without synchronization.
   
   In a concurrent scenario the reader could see a partially-constructed String 
reference (unlikely on x86, possible on ARM) or a stale value. Consider making 
it volatile, or bundling status+message in a single immutable snapshot object 
that is atomically swapped.
   
   Since we do add support for ARM based processors, do you think this would be 
good to address?



-- 
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]

Reply via email to