Skip to content

Shutdown order seems to be backwards #1544

@kamalaboulhosn

Description

@kamalaboulhosn

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    api: pubsubIssues related to the googleapis/java-pubsub API.priority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions