kaisun2000 commented on issue #1394:
URL: https://github.com/apache/helix/issues/1394#issuecomment-699338155
1. enhance log to see what state job is or ctx is null
```
if (ctx == null || !allowedStates.contains(ctx.getJobState(jobName))) {
throw new HelixException(
- String.format("Workflow \"%s\" context is null or job \"%s\" is
not in states: %s",
- workflowName, jobName, allowedStates));
+ String.format("Workflow \"%s\" context is null or job \"%s\" is
not in states: %s; ctx is %s, jobState is %s .",
+ workflowName, jobName, allowedStates, ctx == null ? "null" :
ctx, ctx != null ? ctx.getJobState(jobName) : "null"));
}
```
2. don't let job finish too quickly.
```
Set<String> slave = Sets.newHashSet("SLAVE");
JobConfig.Builder job2 = new
JobConfig.Builder().setCommand(MockTask.TASK_COMMAND)
.setJobCommandConfigMap(Collections.singletonMap(MockTask.JOB_DELAY,
"2000"))
.setTargetResource(WorkflowGenerator.DEFAULT_TGT_DB).setTargetPartitionStates(slave);
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]