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

Cannot stop subscriber #2103

Closed
pongad opened this Issue Jun 1, 2017 · 1 comment

Comments

Projects
None yet
2 participants
@pongad
Contributor

pongad commented Jun 1, 2017

If we create a subscriber using with FixedChannelProvider and FixedExecutorProvider and do this

subscriber.startAsync().awaitRunning();
System.err.println("running");
subscriber.stopAsync().awaitTerminated();
System.err.println("stopped");
for (;;) {
  Thread.sleep(1000);
}

we keep pulling messages forever. Stopping subscriber flushes waits for all messages to finish processing, but it does not stop the polling chain from continuing.

@pongad pongad self-assigned this Jun 1, 2017

pongad added a commit to pongad/google-cloud-java that referenced this issue Jun 5, 2017

pubsub: eventually stop polling after termination
Update #2103.

This does not completely fix the problem.
If an RPC is started before the shutdown, the RPC won't be canceled.
Depending on how the channels and executors are set up,
messages in the said RPCs might be lease-extended.

With this PR, at least we're not polling forever anymore.

pongad added a commit that referenced this issue Jun 6, 2017

pubsub: eventually stop polling after termination (#2113)
Update #2103.

This does not completely fix the problem.
If an RPC is started before the shutdown, the RPC won't be canceled.
Depending on how the channels and executors are set up,
messages in the said RPCs might be lease-extended.

With this PR, at least we're not polling forever anymore.
@pongad

This comment has been minimized.

Show comment
Hide comment
@pongad

pongad Sep 8, 2017

Contributor

The polling implementation is being removed in favor of streaming, and streaming shouldn't have this problem.

Contributor

pongad commented Sep 8, 2017

The polling implementation is being removed in favor of streaming, and streaming shouldn't have this problem.

@pongad pongad closed this Sep 8, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment