diff --git a/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/pubsublite/SubscriptionPartitionLoader.java b/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/pubsublite/SubscriptionPartitionLoader.java index e411d801a7f7..866e92229ba6 100644 --- a/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/pubsublite/SubscriptionPartitionLoader.java +++ b/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/pubsublite/SubscriptionPartitionLoader.java @@ -92,9 +92,7 @@ public PollResult apply(TopicPath element, Context c) { }) .withPollInterval(pollDuration) .withTerminationPerInput( - terminate - ? Watch.Growth.afterTotalOf(pollDuration.multipliedBy(10)) - : Watch.Growth.never())); + terminate ? Watch.Growth.afterIterations(10) : Watch.Growth.never())); return partitions.apply( MapElements.into(TypeDescriptor.of(SubscriptionPartition.class)) .via(kv -> SubscriptionPartition.of(subscription, kv.getValue())));