-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
why checking blank line from stdin input #40
Comments
I have encountered cases where the Java process Python communicates with will fail, and as a result, reading from stdin yields an infinite stream of empty lines. The blank line check was a hacky workaround, and the number 20 was arbitrary; I thought maybe blank lines could occur in some data streams but 20 was enough to confirm there was a problem. Since writing this code, I have found the following note in the Python documentation: http://docs.python.org/2/library/stdtypes.html The advantage of leaving the newline on is that returning an empty string is then an unambiguous EOF indication. I should fix this at some point. |
The link is broken. Could you fix it or post the note you found? |
I fixed the link. I was missing the "l" in "html". |
Thanks. As we known, Storm uses ZeroMQ as communation layer among machines. It's somehow strange that Storm chooses the native pipe instead of ZeroMQ as IPC between storm worker process and outer multi-lang process. |
I think they were trying to keep the multilanguage binding very simple. I agree it makes things hard to debug. Have you looked at the unit test support in Petrel? Using those tools, it's possible to do most of your development and testing outside of Storm, which makes debugging much easier. For example, you can use pdb and print statements. |
Yes, I have looked at the 'mock.py' and 'tests' dir in the source code. It's should be quite helpful when debugging the application logic. |
any idea how to fix this? I have a topology that runs in local mode and on my local 1 node cluster but has this error when I push it to my new QA cluster. It has to be something with storm configuration on the new cluster I guess? |
If the Python workers are exiting due to blank lines, then this is almost certainly a symptom, not the problem itself. It indicates that the Java process on the other end of the stdin/stdout "channel" has exited, probably due to an error. Check the Storm logs and your setup, ask on the Google group, etc. Sorry I can't offer more specific help. |
thank you, I figured it out Petrel wasn't installed properly on all the servers. I know this might be obvious but you may want to add something to the docs specifically stating on which nodes petrel is required. |
Can you read the following section? https://github.com/AirSage/Petrel#deploy-and-run Did you have to install Petrel itself on the machines? As I mentioned in that section, each machine needs some underlying tools but should not require Petrel itself, because it is deployed by Storm, embedded within the topology jar file. |
once I installed Petrel on all the nodes this problem when away |
Hi,
I use Petrel to run some gevent-patched python code on top of storm. The code runs for a while and then some error happens. Ths log file looks like:
I check the Petrel code in "storm.py". This exception is thrown when 20 empty lines are met from stdin input rather than when stdin is closed.
What is the purpose of checking blank line from stdin? why 20 empty lines not 30 or more? on what occasion the "blank line checking" could to be disabled?
The text was updated successfully, but these errors were encountered: