[
https://issues.apache.org/jira/browse/FLINK-5823?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16220232#comment-16220232
]
ASF GitHub Bot commented on FLINK-5823:
---------------------------------------
Github user StephanEwen commented on a diff in the pull request:
https://github.com/apache/flink/pull/4907#discussion_r147092074
--- Diff: flink-core/src/main/java/org/apache/flink/util/FileUtils.java ---
@@ -243,11 +245,19 @@ else if (directory.exists()) {
* @throws IOException if the delete operation fails
*/
public static boolean deletePathIfEmpty(FileSystem fileSystem, Path
path) throws IOException {
- FileStatus[] fileStatuses = null;
+ final FileStatus[] fileStatuses;
try {
fileStatuses = fileSystem.listStatus(path);
- } catch (Exception ignored) {}
+ }
+ catch (FileNotFoundException e) {
+ // path already deleted
+ return true;
+ }
+ catch (Exception e) {
+ // could not access directory, cannot delete
--- End diff --
I have heard often that logging in utility functions is usually not
advised, because the utility cannot decide whether it is actually a problem or
not. Logging in utilities often leads to hard to log pollution.
Logging should happen in the caller of the utility, which can interpret the
context and whether it is actually a problem. If the caller calls a utility
that does not report problems properly (a silent utility function), then its
the wrong utility for the caller.
> Store Checkpoint Root Metadata in StateBackend (not in HA custom store)
> -----------------------------------------------------------------------
>
> Key: FLINK-5823
> URL: https://issues.apache.org/jira/browse/FLINK-5823
> Project: Flink
> Issue Type: Sub-task
> Components: State Backends, Checkpointing
> Reporter: Stephan Ewen
> Assignee: Stephan Ewen
> Priority: Blocker
> Fix For: 1.4.0
>
>
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)