You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@storm.apache.org by ka...@apache.org on 2015/10/03 08:40:16 UTC
[1/3] storm git commit: [STORM-1066] add current directory for worker
process launcher
Repository: storm
Updated Branches:
refs/heads/0.10.x-branch a2af30d20 -> 8cfb6a0fa
[STORM-1066] add current directory for worker process launcher
Project: http://git-wip-us.apache.org/repos/asf/storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/ce4167ff
Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/ce4167ff
Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/ce4167ff
Branch: refs/heads/0.10.x-branch
Commit: ce4167ff4974c41d945fb863ad3f2bbf4c5c265d
Parents: a2af30d
Author: zhuol <zh...@yahoo-inc.com>
Authored: Tue Sep 29 12:49:01 2015 -0500
Committer: Jungtaek Lim <ka...@gmail.com>
Committed: Sat Oct 3 13:56:38 2015 +0900
----------------------------------------------------------------------
.../src/clj/backtype/storm/daemon/supervisor.clj | 18 +++++++++---------
storm-core/src/clj/backtype/storm/util.clj | 3 ++-
2 files changed, 11 insertions(+), 10 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/storm/blob/ce4167ff/storm-core/src/clj/backtype/storm/daemon/supervisor.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/backtype/storm/daemon/supervisor.clj b/storm-core/src/clj/backtype/storm/daemon/supervisor.clj
index 94a6818..548e365 100644
--- a/storm-core/src/clj/backtype/storm/daemon/supervisor.clj
+++ b/storm-core/src/clj/backtype/storm/daemon/supervisor.clj
@@ -195,7 +195,7 @@
(defn generate-supervisor-id []
(uuid))
-(defnk worker-launcher [conf user args :environment {} :log-prefix nil :exit-code-callback nil]
+(defnk worker-launcher [conf user args :environment {} :log-prefix nil :exit-code-callback nil :directory nil]
(let [_ (when (clojure.string/blank? user)
(throw (java.lang.IllegalArgumentException.
"User cannot be blank when calling worker-launcher.")))
@@ -204,7 +204,7 @@
wl (if wl-initial wl-initial (str storm-home "/bin/worker-launcher"))
command (concat [wl user] args)]
(log-message "Running as user:" user " command:" (pr-str command))
- (launch-process command :environment environment :log-prefix log-prefix :exit-code-callback exit-code-callback)
+ (launch-process command :environment environment :log-prefix log-prefix :exit-code-callback exit-code-callback :directory directory)
))
(defnk worker-launcher-and-wait [conf user args :environment {} :log-prefix nil]
@@ -721,15 +721,15 @@
(write-log-metadata! storm-conf user worker-id storm-id port conf)
(set-worker-user! conf worker-id user)
(let [log-prefix (str "Worker Process " worker-id)
- callback (fn [exit-code]
- (log-message log-prefix " exited with code: " exit-code)
- (add-dead-worker worker-id))]
+ callback (fn [exit-code]
+ (log-message log-prefix " exited with code: " exit-code)
+ (add-dead-worker worker-id))
+ worker-dir (worker-root conf worker-id)]
(remove-dead-worker worker-id)
(if run-worker-as-user
- (let [worker-dir (worker-root conf worker-id)]
- (worker-launcher conf user ["worker" worker-dir (write-script worker-dir command :environment topology-worker-environment)] :log-prefix log-prefix :exit-code-callback callback))
- (launch-process command :environment topology-worker-environment :log-prefix log-prefix :exit-code-callback callback)
- ))))
+ (worker-launcher conf user ["worker" worker-dir (write-script worker-dir command :environment topology-worker-environment)] :log-prefix log-prefix :exit-code-callback callback :directory (File. worker-dir))
+ (launch-process command :environment topology-worker-environment :log-prefix log-prefix :exit-code-callback callback :directory (File. worker-dir)))
+ )))
;; local implementation
http://git-wip-us.apache.org/repos/asf/storm/blob/ce4167ff/storm-core/src/clj/backtype/storm/util.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/backtype/storm/util.clj b/storm-core/src/clj/backtype/storm/util.clj
index 1762a5f..b43770f 100644
--- a/storm-core/src/clj/backtype/storm/util.clj
+++ b/storm-core/src/clj/backtype/storm/util.clj
@@ -523,9 +523,10 @@
))
(defnk launch-process
- [command :environment {} :log-prefix nil :exit-code-callback nil]
+ [command :environment {} :log-prefix nil :exit-code-callback nil :directory nil]
(let [builder (ProcessBuilder. command)
process-env (.environment builder)]
+ (when directory (.directory builder directory))
(.redirectErrorStream builder true)
(doseq [[k v] environment]
(.put process-env k v))
[3/3] storm git commit: add STORM-1066 to CHANGELOG.md
Posted by ka...@apache.org.
add STORM-1066 to CHANGELOG.md
Project: http://git-wip-us.apache.org/repos/asf/storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/8cfb6a0f
Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/8cfb6a0f
Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/8cfb6a0f
Branch: refs/heads/0.10.x-branch
Commit: 8cfb6a0fa1767285c1e433f09604e73035f796b9
Parents: bf0f3c0
Author: Jungtaek Lim <ka...@gmail.com>
Authored: Sat Oct 3 15:39:59 2015 +0900
Committer: Jungtaek Lim <ka...@gmail.com>
Committed: Sat Oct 3 15:39:59 2015 +0900
----------------------------------------------------------------------
CHANGELOG.md | 1 +
1 file changed, 1 insertion(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/storm/blob/8cfb6a0f/CHANGELOG.md
----------------------------------------------------------------------
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 19f8e0b..aad9824 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,4 +1,5 @@
## 0.10.0
+ * STORM-1066: Specify current directory when supervisor launches a worker
* STORM-1012: Shaded everything that was not already shaded
* STORM-967: Shaded everything that was not already shaded
* STORM-922: Shaded everything that was not already shaded
[2/3] storm git commit: Fix one bug in absolute-storm-local-dir
function
Posted by ka...@apache.org.
Fix one bug in absolute-storm-local-dir function
Project: http://git-wip-us.apache.org/repos/asf/storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/bf0f3c01
Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/bf0f3c01
Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/bf0f3c01
Branch: refs/heads/0.10.x-branch
Commit: bf0f3c011c610f2e81a561ae8e90d20bed8c79ad
Parents: ce4167f
Author: zhuol <zh...@yahoo-inc.com>
Authored: Tue Sep 29 15:17:53 2015 -0500
Committer: Jungtaek Lim <ka...@gmail.com>
Committed: Sat Oct 3 13:56:44 2015 +0900
----------------------------------------------------------------------
storm-core/src/clj/backtype/storm/config.clj | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/storm/blob/bf0f3c01/storm-core/src/clj/backtype/storm/config.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/backtype/storm/config.clj b/storm-core/src/clj/backtype/storm/config.clj
index 48a13b0..b5c57ba 100644
--- a/storm-core/src/clj/backtype/storm/config.clj
+++ b/storm-core/src/clj/backtype/storm/config.clj
@@ -134,7 +134,9 @@
(defn absolute-storm-local-dir [conf]
(let [storm-home (System/getProperty "storm.home")
path (conf STORM-LOCAL-DIR)]
- (if (is-absolute-path? path) path (str storm-home file-path-separator path))))
+ (if path
+ (if (is-absolute-path? path) path (str storm-home file-path-separator path))
+ (str storm-home file-path-separator "storm-local"))))
(defn master-local-dir
[conf]