Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ protected void doStop() {
}

private void pullMessages(final Duration backoff) {
if (!isAlive()) {

This comment was marked as spam.

return;
}
ListenableFuture<PullResponse> pullResult =
stub.withDeadlineAfter(DEFAULT_TIMEOUT.toMillis(), TimeUnit.MILLISECONDS)
.pull(
Expand Down Expand Up @@ -201,7 +204,9 @@ public void run() {
}

private boolean isAlive() {
return state() == State.RUNNING || state() == State.STARTING;
// Read state only once. Because of threading, different calls can give different results.
State state = state();
return state == State.RUNNING || state == State.STARTING;
}

@Override
Expand Down