This is an automated email from the ASF dual-hosted git repository.
aplex pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/gobblin.git
The following commit(s) were added to refs/heads/master by this push:
new ba89b2b [GOBBLIN-1514] Throw more useful error from already cancelled
tasks (#3362)
ba89b2b is described below
commit ba89b2b85f767256f980e0ea7fea75d6a8c5fc81
Author: Jack Moseley <[email protected]>
AuthorDate: Thu Aug 12 11:17:16 2021 -0700
[GOBBLIN-1514] Throw more useful error from already cancelled tasks (#3362)
Currently sometimes when a task is attempted to be cancelled but is
unsuccessful (due to helix being disconnected for example), the job will
continue to run on the worker but the taskdriver will delete the jobState,
causing an NPE here. This PR just throws a better error message, since the job
is meant to be cancelled anyway.
---
.../src/main/java/org/apache/gobblin/cluster/SingleTask.java | 4 ++++
1 file changed, 4 insertions(+)
diff --git
a/gobblin-cluster/src/main/java/org/apache/gobblin/cluster/SingleTask.java
b/gobblin-cluster/src/main/java/org/apache/gobblin/cluster/SingleTask.java
index b4397f1..93caab4 100644
--- a/gobblin-cluster/src/main/java/org/apache/gobblin/cluster/SingleTask.java
+++ b/gobblin-cluster/src/main/java/org/apache/gobblin/cluster/SingleTask.java
@@ -112,6 +112,10 @@ public class SingleTask {
public void run()
throws IOException, InterruptedException {
+ if (_jobState == null) {
+ throw new RuntimeException("jobState is null. Task may have already been
cancelled.");
+ }
+
// Add dynamic configuration to the job state
_dynamicConfig.entrySet().forEach(e -> _jobState.setProp(e.getKey(),
e.getValue().unwrapped().toString()));