Skip to content

Commit

Permalink
Log job state on unsuccessful cancel
Browse files Browse the repository at this point in the history
  • Loading branch information
jkff committed Mar 23, 2017
1 parent 70efdd0 commit a2f16d8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -354,8 +354,9 @@ public State cancel() throws IOException {
return state;
} else {
String errorMsg = String.format(
"Failed to cancel the job, "
"Failed to cancel job in state %s, "
+ "please go to the Developers Console to cancel it manually: %s",
state,
MonitoringUtil.getJobMonitoringPageURL(getProjectId(), getJobId()));
LOG.warn(errorMsg);
throw new IOException(errorMsg, e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -755,7 +755,7 @@ public void testCancelUnterminatedJobThatFails() throws IOException {
DataflowPipelineJob job = new DataflowPipelineJob(JOB_ID, options, null);

thrown.expect(IOException.class);
thrown.expectMessage("Failed to cancel the job, "
thrown.expectMessage("Failed to cancel job in state RUNNING, "
+ "please go to the Developers Console to cancel it manually:");
job.cancel();

Expand Down

0 comments on commit a2f16d8

Please sign in to comment.