Skip to content

Commit

Permalink
fix: create inFlightSeek on stream reinitialize (#35)
Browse files Browse the repository at this point in the history
When a stream reconnects, a seek request is made on occasion.  We need to set an inFlightSeek, otherwise we run into the following permanent error:

https://github.com/googleapis/java-pubsublite/blob/master/google-cloud-pubsublite/src/main/java/com/google/cloud/pubsublite/internal/wire/SubscriberImpl.java#L211
  • Loading branch information
hannahrogers-google authored May 12, 2020
1 parent b3b064f commit ba4f5b8
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,11 @@ public void triggerReinitialize() {
checkArgument(connectedSubscriber.isPresent());
nextOffsetTracker
.requestForRestart()
.ifPresent(request -> connectedSubscriber.get().seek(request));
.ifPresent(
request -> {
inFlightSeek = Optional.of(SettableApiFuture.create());
connectedSubscriber.get().seek(request);
});
tokenCounter
.requestForRestart()
.ifPresent(request -> connectedSubscriber.get().allowFlow(request));
Expand Down

0 comments on commit ba4f5b8

Please sign in to comment.