-
Notifications
You must be signed in to change notification settings - Fork 206
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
fix: move await_msg_callbacks flag to subscribe() method #320
Conversation
This reverts commit 16bf588.
This is to keep the StreamingPullFuture's surface intact for compatibility with PubSub Lite client.
As far as I can tell, this will not break Pub/Sub Lite python. I will separately work on making it clear which API surfaces Pub/Sub Lite overrides so it is at least clear in the future what kind of changes would break the other client, and figuring out how to test this. Implicit LGTM, but I think I have write access, so I won't officially approve. |
FWIW, as per offline discussion - the try:
streaming_future.result()
except Something:
streaming_future.cancel() # should return "fast"
streaming_future.result() # this should block until active callbacks are done (if await_msg_callbacks was set) Since right now the graceful shutdown is not released anywhere, we can still change the behavior. If we do, we will likely have to throw in a new sample or two to explain how the streaming pull future's |
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 Peter for the quick fix. I gave it a try and it did fix googleapis/python-pubsublite#95.
LGTM.
Good to hear that it works. @dpcollins-google made a good point that the streaming pull future's The The solution is to move the shutdown operations into their own thread, similarly to what we already do when we close the manager due to a terminal stream error. I'm probably offline tomorrow, but can add this before the end of the week. If we are not in a hurry with the release, I'd say we wait for this improvement before merging. Otherwise just remove the label and I'll submit a separate PR. |
Made the I will follow up with a sample, but if the PR is merged in the meantime, I can open a separate PR. Edit: The samples README, when re-generated, should pick up the new snippet automatically, right? |
cla/google status update is stuck. |
@plamut I force rescanned to get the CLA signed. |
Here is the summary of changes. You are about to add 1 region tag.
This comment is generated by snippet-bot.
|
I'll take a look at this on Monday. |
Apologies, got caught up today. Tomorrow for sure. :) |
Very excited to see this fix merged in, thanks for the awesome work here :-) |
Reverts #315 that reverted #292.
Fixes #318.
Supersedes #319.
A full revert of #292 re-introduces several issues that have been fixed with it. This PR thus reverts the revert, but also makes the necessary (less radical) changes that avoid the error in PubSub Lite client - the
StreamingPullFuture
is now intact, and theawait_msg_callbacks
parameter of thecancel()
method has been moved to subscriber client'ssubscribe()
method.Please test the PubSub Lite client with this PR branch to verify that it indeed doesn't break it anymore, thanks!
PR checklist: