[ https://issues.apache.org/jira/browse/STORM-548?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14197930#comment-14197930 ]
ASF GitHub Bot commented on STORM-548: -------------------------------------- GitHub user caofangkun opened a pull request: https://github.com/apache/storm/pull/307 STORM-548:Receive Thread Shutdown hook should connect to local-hostname ... backtype.storm.messaging.loader#launch-receive-thread! kill-socket should connect to local hostname but not "localhost" You can merge this pull request into a Git repository by running: $ git pull https://github.com/caofangkun/apache-storm storm-548 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/storm/pull/307.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #307 ---- commit f9707b58e7664a0618776bea91402b895541ab00 Author: caofangkun <caofang...@gmail.com> Date: 2014-11-05T08:56:40Z STORM-548:Receive Thread Shutdown hook should connect to local-hostname but not localhost ---- > Receive Thread Shutdown hook should connect to local hostname but not > "localhost" > ---------------------------------------------------------------------------------- > > Key: STORM-548 > URL: https://issues.apache.org/jira/browse/STORM-548 > Project: Apache Storm > Issue Type: Bug > Affects Versions: 0.9.3-rc2 > Reporter: caofangkun > Priority: Minor > > backtype.storm.messaging.loader#launch-receive-thread! > kill-socket should connect to local hostname but not "localhost" > See Code Line 72: > https://github.com/apache/storm/blob/master/storm-core/src/clj/backtype/storm/messaging/loader.clj#L72 > {code:title=loader.clj|borderStyle=solid} > Index: src/clj/backtype/storm/messaging/loader.clj > =================================================================== > --- src/clj/backtype/storm/messaging/loader.clj (revision 4017) > +++ src/clj/backtype/storm/messaging/loader.clj (working copy) > @@ -65,11 +65,12 @@ > :kill-fn (fn [t] (System/exit 1)) > :priority Thread/NORM_PRIORITY] > (let [max-buffer-size (int max-buffer-size) > + local-hostname (memoized-local-hostname) > socket (.bind ^IContext context storm-id port) > thread-count (if receiver-thread-count receiver-thread-count 1) > vthreads (mk-receive-threads context storm-id port transfer-local-fn > daemon kill-fn priority socket max-buffer-size thread-count)] > (fn [] > - (let [kill-socket (.connect ^IContext context storm-id "localhost" > port)] > + (let [kill-socket (.connect ^IContext context storm-id local-hostname > port)] > (log-message "Shutting down receiving-thread: [" storm-id ", " port > "]") > (.send ^IConnection kill-socket > -1 (byte-array [])) > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)