zentol commented on a change in pull request #12560:
URL: https://github.com/apache/flink/pull/12560#discussion_r438072525



##########
File path: 
flink-runtime-web/src/main/java/org/apache/flink/runtime/webmonitor/history/HistoryServerArchiveFetcher.java
##########
@@ -302,18 +289,37 @@ public void run() {
 
                        cachedArchives.removeAll(jobsToRemove);
                        jobsToRemove.forEach(removedJobID -> {
-                               try {
-                                       Files.deleteIfExists(new 
File(webOverviewDir, removedJobID + JSON_FILE_ENDING).toPath());
-                                       FileUtils.deleteDirectory(new 
File(webJobDir, removedJobID));
-                               } catch (IOException e) {
-                                       LOG.error("Failure while removing job 
overview for job {}.", removedJobID, e);
-                               }
+                               deleteJobFiles(removedJobID);
                                deleteLog.add(new ArchiveEvent(removedJobID, 
ArchiveEventType.DELETED));
                        });
 
                        return deleteLog;
                }
 
+               private void deleteJobFiles(String jobID) {
+                       // Make sure we do not include this job in the overview
+                       try {
+                               Files.deleteIfExists(new File(webOverviewDir, 
jobID + JSON_FILE_ENDING).toPath());
+                       } catch (IOException ioe) {
+                               LOG.warn("Could not delete file from overview 
directory.", ioe);

Review comment:
       This changes the log level, which is a bit annoying for the cleanup if a 
download fails. In that case it is quite likely that we will try to delete 
something that was never created; for which we shouldn't be logging a warning.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to