GitHub user dashengju opened a pull request:
https://github.com/apache/incubator-storm/pull/140
STROM-351 multilang python process fall into endless loop
https://issues.apache.org/jira/browse/STORM-351
1. steps to reproduce
1) write a topology with a python bolt, run the topology on storm; then
there will be two process for the bolt: the worker(java process for ShellBolt),
python process.
2ï¼kill -9 the worker(java process for ShellBolt);
2. expected behavior
the worker exit and the python process exist
3. actual, incorrect behavior
the worker exit, but the python process never exist and fall into endless
loop
4. analyse
in storm.pyï¼read tuple from stdin with follow function:
def readMsg():
msg = ""
while True:
line = sys.stdin.readline()[0:-1]
if line == "end":
break
msg = msg + line + "\n"
return json_decode(msg[0:-1])
when sys.stdin is closed, EOF is encountered, readline() return None, so
readMsg fall into endless loop.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/dashengju/incubator-storm Multilang_stormpy
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/incubator-storm/pull/140.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 #140
----
commit 7ce0bff2ca63c830e148385b4cce231152843d58
Author: JuDasheng <[email protected]>
Date: 2014-06-13T04:12:54Z
change bug of readMsg
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---