eemario commented on code in PR #27755:
URL: https://github.com/apache/flink/pull/27755#discussion_r2985327887
##########
flink-runtime/src/main/java/org/apache/flink/runtime/blob/PermanentBlobCache.java:
##########
@@ -208,33 +235,59 @@ public void registerJob(JobID jobId) {
ref.keepUntil = -1;
}
++ref.references;
+
+ // also register under application because the job may use
application-level blobs
+ RefCount applicationRef =
applicationRefCounters.get(applicationId);
+ if (applicationRef == null) {
+ applicationRef = new RefCount();
+ applicationRefCounters.put(applicationId, applicationRef);
+ } else {
+ // reset cleanup timeout
+ applicationRef.keepUntil = -1;
+ }
+ ++applicationRef.references;
}
}
/**
* Unregisters use of job-related BLOBs and allow them to be released.
*
* @param jobId ID of the job this blob belongs to
- * @see #registerJob(JobID)
+ * @see #registerJob(JobID, ApplicationID)
*/
@Override
- public void releaseJob(JobID jobId) {
+ public void releaseJob(JobID jobId, ApplicationID applicationId) {
checkNotNull(jobId);
synchronized (jobRefCounters) {
+ String warning =
+ "improper use of releaseJob() without a matching number of
registerJob() calls for jobId "
+ + jobId;
+
RefCount ref = jobRefCounters.get(jobId);
if (ref == null || ref.references == 0) {
- log.warn(
- "improper use of releaseJob() without a matching
number of registerJob() calls for jobId "
- + jobId);
+ log.warn(warning);
return;
}
--ref.references;
if (ref.references == 0) {
ref.keepUntil = System.currentTimeMillis() + cleanupInterval;
}
+
+ // make sure application related data can be cleaned up
+ RefCount applicationRef =
applicationRefCounters.get(applicationId);
+
+ if (applicationRef == null || applicationRef.references == 0) {
+ log.warn(warning);
Review Comment:
Updated.
##########
flink-clients/src/main/java/org/apache/flink/client/program/JarInfo.java:
##########
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.client.program;
+
+import org.apache.flink.runtime.blob.PermanentBlobKey;
+
+import java.io.Serializable;
+
+/** Info about a jar. */
+public class JarInfo implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+ public final String jarName;
Review Comment:
Updated.
--
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]