You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by "arunpandianp (via GitHub)" <gi...@apache.org> on 2025/10/07 01:19:40 UTC

[PR] [Dataflow Streaming] Remove one wait for GetData [beam]

arunpandianp opened a new pull request, #36417:
URL: https://github.com/apache/beam/pull/36417

   Harness threads will no longer wait for sending threads directly. They'll wait on the responseStream and will observe failures when the responseStream is cancelled.
   
   Reduces context switches and cpu usage under GetData
   
   Before profile:  <img width="3456" height="1984" alt="image" src="https://github.com/user-attachments/assets/dbfaf430-05e6-4e87-9335-4e245062d9bf" />
   After profile: 
   <img width="3456" height="1984" alt="image" src="https://github.com/user-attachments/assets/949ce7ce-6115-468a-ad85-31ff747c8afe" />
   


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


Re: [PR] [Dataflow Streaming] Remove one wait for GetData [beam]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #36417:
URL: https://github.com/apache/beam/pull/36417#issuecomment-3374976442

   Stopping reviewer notifications for this pull request: review requested by someone other than the bot, ceding control. If you'd like to restart, comment `assign set of reviewers`


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


Re: [PR] [Dataflow Streaming] Remove one wait for GetData [beam]

Posted by "arunpandianp (via GitHub)" <gi...@apache.org>.
arunpandianp commented on code in PR #36417:
URL: https://github.com/apache/beam/pull/36417#discussion_r2409890844


##########
runners/google-cloud-dataflow-java/worker/src/main/java/org/apache/beam/runners/dataflow/worker/windmill/client/grpc/GrpcGetDataStreamRequests.java:
##########
@@ -197,6 +197,9 @@ void notifySent() {
      */
     void notifyFailed() {
       failed = true;
+      for (QueuedRequest request : requests) {

Review Comment:
   > Can you make sure it is ok with other cases?
   
   Yes. All batches and queued requests are guarded by GprcGetDataStream.this.



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


Re: [PR] [Dataflow Streaming] Remove one wait for GetData [beam]

Posted by "arunpandianp (via GitHub)" <gi...@apache.org>.
arunpandianp commented on code in PR #36417:
URL: https://github.com/apache/beam/pull/36417#discussion_r2409892768


##########
runners/google-cloud-dataflow-java/worker/src/main/java/org/apache/beam/runners/dataflow/worker/windmill/client/grpc/GrpcGetDataStream.java:
##########
@@ -504,9 +504,6 @@ private void queueRequestAndWait(QueuedRequest request)
       trySendBatch(batch);

Review Comment:
   +1 removing it should be fine. Will double check and send it as a separate change.



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


Re: [PR] [Dataflow Streaming] Remove one wait for GetData [beam]

Posted by "arunpandianp (via GitHub)" <gi...@apache.org>.
arunpandianp commented on PR #36417:
URL: https://github.com/apache/beam/pull/36417#issuecomment-3374975307

   R: @scwhittle 


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


Re: [PR] [Dataflow Streaming] Remove one wait for GetData [beam]

Posted by "scwhittle (via GitHub)" <gi...@apache.org>.
scwhittle commented on code in PR #36417:
URL: https://github.com/apache/beam/pull/36417#discussion_r2409758481


##########
runners/google-cloud-dataflow-java/worker/src/main/java/org/apache/beam/runners/dataflow/worker/windmill/client/grpc/GrpcGetDataStream.java:
##########
@@ -504,9 +504,6 @@ private void queueRequestAndWait(QueuedRequest request)
       trySendBatch(batch);

Review Comment:
   should we also remove the prevBatch waiting and instead just try to send?  It means we are contending on the synchronized block and may not maintain the ordering but the synchronized primitive may handle that better than our daisy-chaining of waitForSendOrFailNotification across threads.
   
   Tests would likely need updating if they rely on the ordering. But would be interesting to see if that also helps out on the profile.



##########
runners/google-cloud-dataflow-java/worker/src/main/java/org/apache/beam/runners/dataflow/worker/windmill/client/grpc/GrpcGetDataStreamRequests.java:
##########
@@ -197,6 +197,9 @@ void notifySent() {
      */
     void notifyFailed() {
       failed = true;
+      for (QueuedRequest request : requests) {

Review Comment:
   this method is supposed to be thread-safe by comment but no longer is
   
   However GprcGetDataStream seems like it protects the queues within the queue with synchronization so we could perhaps remove that comment.  Can you make sure it is ok with other cases?
   



##########
runners/google-cloud-dataflow-java/worker/src/main/java/org/apache/beam/runners/dataflow/worker/windmill/client/grpc/GrpcGetDataStream.java:
##########
@@ -504,9 +504,6 @@ private void queueRequestAndWait(QueuedRequest request)
       trySendBatch(batch);
       // Since the above send may not succeed, we fall through to block on sending or failure.

Review Comment:
   update comment



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


Re: [PR] [Dataflow Streaming] Remove one wait for GetData [beam]

Posted by "scwhittle (via GitHub)" <gi...@apache.org>.
scwhittle merged PR #36417:
URL: https://github.com/apache/beam/pull/36417


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