Github user zentol commented on a diff in the pull request:

    https://github.com/apache/flink/pull/5580#discussion_r179056758
  
    --- Diff: 
flink-runtime/src/main/java/org/apache/flink/runtime/filecache/FileCache.java 
---
    @@ -262,106 +216,120 @@ private static Thread createShutdownHook(final 
FileCache cache, final Logger log
                );
        }
     
    +   public void releaseJob(JobID jobId, ExecutionAttemptID executionId) {
    +           checkNotNull(jobId);
    +
    +           synchronized (lock) {
    +                   Set<ExecutionAttemptID> jobRefCounter = 
jobRefHolders.get(jobId);
    +
    +                   if (jobRefCounter == null || jobRefCounter.isEmpty()) {
    +                           LOG.warn("improper use of releaseJob() without 
a matching number of createTmpFiles() calls for jobId " + jobId);
    +                           return;
    +                   }
    +
    +                   jobRefCounter.remove(executionId);
    --- End diff --
    
    shouldn't we also remove the entries? Otherwise the `entries` map will 
continue to grow until either the TM shuts down or the or crashes with an OOM 
error.


---

Reply via email to