Github user revans2 commented on a diff in the pull request: https://github.com/apache/storm/pull/2893#discussion_r227418284 --- Diff: storm-core/src/native/worker-launcher/impl/worker-launcher.c --- @@ -593,14 +593,17 @@ int recursive_delete(const char *path, int supervisor_owns_dir) { return UNABLE_TO_BUILD_PATH; } + struct stat file_stat; + if(access(path, F_OK) != 0) { if(errno == ENOENT) { - return 0; - } - // Can probably return here, but we'll try to lstat anyway. - } + // we need to handle symlinks that target missing files. + if((lstat(path, &file_stat) != 0) || ((file_stat.st_mode & S_IFMT) != S_IFLNK)) { + return 0; + } --- End diff -- +1 to logging the failure. The only time we get an ENOENT and lstat fails is either there was a race that the file was deleted out from under us (which should be rare so logging it is fine) or if something truly bad happened, and we have another problem we need to debug.
---