Skip to content

Commit cbad789

Browse files
authored
fix: Committer stuck in retry loop on shutdown (#1062)
Close the partition subscriber factory (which contains the client stubs) last. This allows the Committer to send a pending commit to the server on shutdown.
1 parent 76093f4 commit cbad789

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎google-cloud-pubsublite/src/main/java/com/google/cloud/pubsublite/cloudpubsub/SubscriberSettings.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,14 +315,14 @@ Subscriber instantiate() throws ApiException {
315315
}
316316

317317
List<ApiService> services = new ArrayList<>();
318-
services.add(autoCloseableAsApiService(partitionSubscriberFactory));
319318
for (Partition partition : partitions()) {
320319
try {
321320
services.add(partitionSubscriberFactory.newSubscriber(partition));
322321
} catch (CheckedApiException e) {
323322
throw e.underlying;
324323
}
325324
}
325+
services.add(autoCloseableAsApiService(partitionSubscriberFactory));
326326
return MultiPartitionSubscriber.of(services);
327327
}
328328
}

0 commit comments

Comments
 (0)