Shutdown order seems to be backwards #1544
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.
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 callsrunShutdown()
, which callsmessageDispatcher.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.The text was updated successfully, but these errors were encountered: