Github user srdo commented on a diff in the pull request:
https://github.com/apache/storm/pull/2686#discussion_r191043439
--- Diff:
storm-server/src/main/java/org/apache/storm/daemon/nimbus/Nimbus.java ---
@@ -828,12 +831,54 @@ private static boolean
isTopologyActive(IStormClusterState state, String topoNam
}
}
+ private static void rotateTopologyCleanupMap(long deletionDelay) {
+ if (Time.currentTimeMillis() - topologyCleanupRotationTime >
deletionDelay) {
+ topologyCleanupDetected.rotate();
+ topologyCleanupRotationTime = Time.currentTimeMillis();
+ }
+ }
+
+ private static long getTopologyCleanupDetectedTime(String topologyId) {
+ Long firstDetectedForDeletion =
topologyCleanupDetected.get(topologyId);
+ if (firstDetectedForDeletion == null) {
+ firstDetectedForDeletion = Time.currentTimeMillis();
+ topologyCleanupDetected.put(topologyId,
firstDetectedForDeletion);
+ }
+ return firstDetectedForDeletion;
+ }
+
+ /**
+ * Finds blobstore entries with no matching topology. Waits
NIMBUS_TOPOLOGY_BLOBSTORE_DELETION_DELAY_MSEC
+ * before reporting the topologies found. The delay is to prevent a
race condition between when a blobstore
--- End diff --
This phrasing makes it sound like the method will block. How about
something like "Blobstore entries first detected less than
NIMBUS_TOPOLOGY_BLOBSTORE_DELETION_DELAY_MSEC ago are ignored"?
---