Github user jihoonson commented on a diff in the pull request:
https://github.com/apache/tajo/pull/37#discussion_r14018047
--- Diff: tajo-core/src/main/java/org/apache/tajo/worker/Task.java ---
@@ -702,15 +706,24 @@ public void run() {
try {
if (context.isPorgressChanged()) {
- masterStub.statusUpdate(null, getReport(),
NullCallback.get());
+ masterStub.statusUpdate(errorControllers[0], getReport(),
NullCallback.get());
} else {
- masterStub.ping(null, taskId.getProto(),
NullCallback.get());
+ masterStub.ping(errorControllers[1], taskId.getProto(),
NullCallback.get());
+ }
+ for (int i = 0; i < errorControllers.length; i++) {
+ if (errorControllers[i].failed()) {
+ String errorText = errorControllers[i].errorText();
+ throw new IOException(errorText);
+ }
}
} catch (Throwable t) {
LOG.error(t.getMessage(), t);
- remainingRetries -=1;
+ if (t.getMessage() != null &&
t.getMessage().indexOf("java.nio.channels.ClosedChannelException") >= 0) {
--- End diff --
Sorry, I mmisunderstood that the throwable can be ClosedChannelException.
But, this code looks tricky.
Are there any better way to handle this exception?
---
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.
---