Skip to content
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

Adding error command handling to ShellSpout. #719

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions storm-core/src/jvm/backtype/storm/spout/ShellSpout.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ private void querySubprocess(Object query) {
} else if (command.equals("log")) {
String msg = (String) action.get("msg");
LOG.info("Shell msg: " + msg);
} else if (command.equals("error")) {
String msg = (String) action.get("msg");
_collector.reportError(new Exception("Shell Process Exception: " + msg));
return;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If an error is received from a spout, we should probably return to allow the subprocess to be queried again. Otherwise we would be waiting on further messages from the subprocess which is unlikely considering we received an error. That could result in the process waiting indefinitely.

} else if (command.equals("emit")) {
String stream = (String) action.get("stream");
if (stream == null) stream = Utils.DEFAULT_STREAM_ID;
Expand Down