You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2021/11/17 16:11:06 UTC

[GitHub] [beam] lukecwik commented on a change in pull request #16004: Fix race condition in Pub/Sub Lite SDF that causes it to error out when using Runnerv2

lukecwik commented on a change in pull request #16004:
URL: https://github.com/apache/beam/pull/16004#discussion_r751389731



##########
File path: sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/pubsublite/internal/SubscriptionPartitionProcessorImpl.java
##########
@@ -66,23 +66,6 @@
     this.flowControlSettings = flowControlSettings;
   }
 
-  @Override
-  @SuppressWarnings("argument.type.incompatible")
-  public void start() throws CheckedApiException {
-    this.subscriber.addListener(this, SystemExecutors.getFuturesExecutor());
-    this.subscriber.startAsync();
-    this.subscriber.awaitRunning();
-    try {
-      this.subscriber.allowFlow(
-          FlowControlRequest.newBuilder()
-              .setAllowedBytes(flowControlSettings.bytesOutstanding())
-              .setAllowedMessages(flowControlSettings.messagesOutstanding())
-              .build());
-    } catch (Throwable t) {
-      throw ExtractStatus.toCanonical(t);
-    }
-  }
-
   private void onMessages(List<SequencedMessage> messages) {
     if (completionFuture.isDone()) {
       return;

Review comment:
       Producing output from another thread will break the assumption that users who use this library may have where they don't need synchronization since methods like startBundle/finishBundle/processElement are all meant to be [accessed from one thread](https://beam.apache.org/documentation/programming-guide/#user-code-thread-compatibility) and will also break similar assumptions in the system (for example counters/monitoring rely on a thread local being set to pass a context object around).




-- 
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.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org