boyuanzz commented on a change in pull request #14069:
URL: https://github.com/apache/beam/pull/14069#discussion_r582514995
##########
File path:
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/pubsublite/PerSubscriptionPartitionSdf.java
##########
@@ -81,15 +84,22 @@ public ProcessContinuation processElement(
.lastClaimed()
.ifPresent(
lastClaimedOffset ->
- finalizer.afterBundleCommit(
- Instant.ofEpochMilli(Long.MAX_VALUE),
- () -> {
- Committer committer =
committerFactory.apply(subscriptionPartition);
- committer.startAsync().awaitRunning();
- // Commit the next-to-deliver offset.
-
committer.commitOffset(Offset.of(lastClaimedOffset.value() + 1)).get();
- committer.stopAsync().awaitTerminated();
- }));
+ /* TODO(boyuanzz): When default dataflow can use finalizers,
undo this.
+ finalizer.afterBundleCommit(
+ Instant.ofEpochMilli(Long.MAX_VALUE),
+ () -> */ {
+ Committer committer =
committerFactory.apply(subscriptionPartition);
+ committer.startAsync().awaitRunning();
+ // Commit the next-to-deliver offset.
+ try {
+ committer.commitOffset(Offset.of(lastClaimedOffset.value() +
1)).get();
Review comment:
For both 1&2, as long as the committing offset doesn't means we are no
longer able to read from that offset, I think that would be fine.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]