yandrey321 commented on code in PR #10988:
URL: https://github.com/apache/ozone/pull/10988#discussion_r3754467499
##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/volume/MutableVolumeSet.java:
##########
@@ -404,6 +405,16 @@ public boolean hasEnoughVolumes() {
return hasEnoughVolumes;
}
+ /**
+ * Returns a consistent snapshot of the storage reports under the volume-set
+ * read lock.
+ *
+ * <p>Do not call this from metrics collection (or any caller that may hold
the
+ * {@code DefaultMetricsSystem} monitor): a volume-failure handler holds the
+ * volume-set write lock while unregistering volume metrics under that same
+ * monitor, so taking the read lock here can deadlock the metrics system. Use
+ * {@link #getStorageReportSnapshot()} from those paths instead.
+ */
public StorageLocationReport[] getStorageReport() {
this.readLock();
Review Comment:
why do we need read lock here?
--
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]