eemario commented on code in PR #27755:
URL: https://github.com/apache/flink/pull/27755#discussion_r2985343093
##########
flink-runtime/src/main/java/org/apache/flink/runtime/blob/PermanentBlobCache.java:
##########
@@ -185,17 +189,40 @@ private void registerJobWithExpiry(JobID jobId, long
expiryTimeout) {
}
}
+ private void registerDetectedApplications() throws IOException {
+ if (storageDir.deref().exists()) {
+ final Collection<ApplicationID> applicationIds =
+
BlobUtils.listExistingApplications(storageDir.deref().toPath());
+
+ final long expiryTimeout = System.currentTimeMillis() +
cleanupInterval;
+ for (ApplicationID applicationId : applicationIds) {
+ registerApplicationWithExpiry(applicationId, expiryTimeout);
+ }
+ }
+ }
+
+ private void registerApplicationWithExpiry(ApplicationID applicationId,
long expiryTimeout) {
+ checkNotNull(applicationId);
+ synchronized (jobRefCounters) {
Review Comment:
The intent is to protect both maps with a single lock, as many operations
read from and write to both simultaneously. Using separate locks might lead to
deadlocks or inconsistencies. To avoid this—and to make the synchronization
strategy clearer—now use a unified refCountersLock.
--
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]