You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@storm.apache.org by bo...@apache.org on 2017/11/03 20:44:44 UTC
[1/2] storm git commit: STORM-2795: Fix race
Repository: storm
Updated Branches:
refs/heads/master 1b8f67c14 -> 89b48d2a8
STORM-2795: Fix race
Project: http://git-wip-us.apache.org/repos/asf/storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/5d95e713
Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/5d95e713
Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/5d95e713
Branch: refs/heads/master
Commit: 5d95e7139493270643e35ffb1ba59628c8402e57
Parents: 1b8f67c
Author: Robert (Bobby) Evans <ev...@yahoo-inc.com>
Authored: Wed Nov 1 09:22:37 2017 -0500
Committer: Robert (Bobby) Evans <ev...@yahoo-inc.com>
Committed: Wed Nov 1 09:23:33 2017 -0500
----------------------------------------------------------------------
.../java/org/apache/storm/localizer/LocalizedResource.java | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/storm/blob/5d95e713/storm-server/src/main/java/org/apache/storm/localizer/LocalizedResource.java
----------------------------------------------------------------------
diff --git a/storm-server/src/main/java/org/apache/storm/localizer/LocalizedResource.java b/storm-server/src/main/java/org/apache/storm/localizer/LocalizedResource.java
index 4f01c30..1ad582b 100644
--- a/storm-server/src/main/java/org/apache/storm/localizer/LocalizedResource.java
+++ b/storm-server/src/main/java/org/apache/storm/localizer/LocalizedResource.java
@@ -29,6 +29,7 @@ import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.nio.file.DirectoryStream;
+import java.nio.file.FileAlreadyExistsException;
import java.nio.file.Files;
import java.nio.file.NoSuchFileException;
import java.nio.file.Path;
@@ -259,7 +260,12 @@ public class LocalizedResource extends LocallyCachedBlob {
LOG.debug("Downloading {} to {}", key, downloadFile);
Path parent = downloadFile.getParent();
if (!Files.exists(parent)) {
- Files.createDirectory(parent);
+ //There is a race here that we can still lose
+ try {
+ Files.createDirectory(parent);
+ } catch (FileAlreadyExistsException e) {
+ //Ignored
+ }
}
try (FileOutputStream out = new FileOutputStream(downloadFile.toFile())) {
while ((len = in.read(buffer)) >= 0) {
[2/2] storm git commit: Merge branch 'STORM-2795' of
https://github.com/revans2/incubator-storm into STORM-2795
Posted by bo...@apache.org.
Merge branch 'STORM-2795' of https://github.com/revans2/incubator-storm into STORM-2795
STORM-2795: Race in downloading resources can cause failure
This closes #2398
Project: http://git-wip-us.apache.org/repos/asf/storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/89b48d2a
Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/89b48d2a
Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/89b48d2a
Branch: refs/heads/master
Commit: 89b48d2a89874ab6656494fc7a9c27f861e50ba6
Parents: 1b8f67c 5d95e71
Author: Robert Evans <ev...@yahoo-inc.com>
Authored: Fri Nov 3 15:30:49 2017 -0500
Committer: Robert Evans <ev...@yahoo-inc.com>
Committed: Fri Nov 3 15:30:49 2017 -0500
----------------------------------------------------------------------
.../java/org/apache/storm/localizer/LocalizedResource.java | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------