-
Notifications
You must be signed in to change notification settings - Fork 4.5k
[BEAM-53] PubsubApiaryClient, PubsubTestClient #213
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
R: @dhalperi |
Wrap Exceptions thrown in StartBundle in the InProcessPipelineRunner
|
I'm guessing this one fell off your radar @dhalperi. |
| LOG.error("Failed to delete subscription: ", e); | ||
| } | ||
| if (finallyBlockException != null) { | ||
| Throwables.propagate(finallyBlockException); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kennknowles fyi
I think the current recommendation is simply:
throw new RuntimeException("Some message", finallyBlockException);Even if you intended to use Throwables.propagate, you should use throw Throwables.propagate... to work around some IDEs/cases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea, see #70.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
|
May as well dump it here. To bootstrap review, can you please update the PR message with everything that's in the diff, assuming I didn't look at your original #120 and discussion with Kenn? |
| options.getGcpCredential(), | ||
| // Do not log 404. It clutters the output and is possibly even required by the caller. | ||
| new RetryHttpRequestInitializer(ImmutableList.of(404)))) | ||
| .setRootUrl(options.getPubsubRootUrl()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you need to do any pubsub-specific failure handling here? 410, 403 rate limited, any of the crap we see in other APIs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is straight from the impl we already have in Transport. It has been load tested, used both from vms and desktop, and seems to do the business.
Note that I'd like to remove Transport.newPubsubClient but it is used from various examples so leaving it in place for a future refactor. I at least marked ti deprecated.
|
(off for root canal. forgive any grumpiness later today...) |
|
|
||
| public String getV1Beta1Path() { | ||
| String[] splits = path.split("/"); | ||
| Preconditions.checkState(splits.length == 4); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general, would strongly prefer to have better error messages at all of these validation checks. For example,
checkState(splits.length == 4, "Expected 4 path components in Pubsub path %s", path);There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
|
LGTM modulo a pending rebase and few minor (optional) comments. |
| // Otherwise we'll fall back to the topic's project. | ||
| // Note that they don't need to be the same. | ||
| String project = c.getPipelineOptions().as(PubsubOptions.class).getProject(); | ||
| if (project == null || project.isEmpty()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isNullOrEmpty?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks.
|
PTAL |
Continuing from #120