Skip to content
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

Shutdown order seems to be backwards #1544

Closed
kamalaboulhosn opened this issue Apr 4, 2023 · 0 comments · Fixed by #1613
Closed

Shutdown order seems to be backwards #1544

kamalaboulhosn opened this issue Apr 4, 2023 · 0 comments · Fixed by #1613
Labels
api: pubsub Issues related to the googleapis/java-pubsub API. priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@kamalaboulhosn
Copy link
Contributor

The doStop method for StreamingSubscriberClient seems like it may be the opposite order of what would allow it to shut down most quickly and cleanly. It first calls runShutdown(), which calls messageDispatcher.stop();. That method waits until there are no outstanding messages. How do we ensure that no new messages come in? If they do, we could seemingly end up in a state where the client can never shut down because more messages come in constantly.

We should see if this can happen and if so, consider changing the order in which we do the shutdown so we do clientStream.closeSendWithError(Status.CANCELLED.asException()); first.

@product-auto-label product-auto-label bot added the api: pubsub Issues related to the googleapis/java-pubsub API. label Apr 4, 2023
@kamalaboulhosn kamalaboulhosn added type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. priority: p2 Moderately-important priority. Fix may not be included in next release. labels May 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: pubsub Issues related to the googleapis/java-pubsub API. priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant