Skip to content

Commit

Permalink
Round 1 Review
Browse files Browse the repository at this point in the history
- Fail if debugging is requested and we're unable to register
- Don't silently retry on 404
  • Loading branch information
bchambers committed Mar 4, 2016
1 parent d1bf084 commit f6c5e99
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -445,15 +445,13 @@ private void maybeRegisterDebuggee(DataflowPipelineOptions options, String uniqu
debuggerClient.controller().debuggees().register(registerReq).execute();
Debuggee debuggee = registerResponse.getDebuggee();
if (debuggee.getStatus() != null && debuggee.getStatus().getIsError()) {
LOG.error("Error registering with debugger: {}",
throw new RuntimeException("Unable to register with the debugger: " +
debuggee.getStatus().getDescription().getFormat());
return;
}

options.setDebuggee(debuggee);
} catch (IOException e) {
System.out.println("Unable to register with debugger: " + e);
LOG.error("Unable to register with debugger:", e);
throw new RuntimeException("Unable to register with the debugger: ", e);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,7 @@ public static Dataflow.Builder newDataflowClient(DataflowPipelineOptions options
public static Clouddebugger.Builder newClouddebuggerClient(DataflowPipelineOptions options) {
return new Clouddebugger.Builder(getTransport(),
getJsonFactory(),
chainHttpRequestInitializer(
options.getGcpCredential(),
// Do not log 404. It clutters the output and is possible even required by the caller.
new RetryHttpRequestInitializer(ImmutableList.of(404))))
chainHttpRequestInitializer(options.getGcpCredential(), new RetryHttpRequestInitializer()))
.setApplicationName(options.getAppName())
.setGoogleClientRequestInitializer(options.getGoogleApiTrace());
}
Expand Down

0 comments on commit f6c5e99

Please sign in to comment.