You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2020/02/22 02:19:48 UTC

[GitHub] [flink-statefun] tzulitai commented on a change in pull request #30: [FLINK-16226] Add Backpressure to HttpFunction

tzulitai commented on a change in pull request #30: [FLINK-16226] Add Backpressure to HttpFunction
URL: https://github.com/apache/flink-statefun/pull/30#discussion_r382876852
 
 

 ##########
 File path: statefun-flink/statefun-flink-core/src/main/java/org/apache/flink/statefun/flink/core/httpfn/HttpFunction.java
 ##########
 @@ -109,9 +137,17 @@ private void onAsyncResult(
     handleInvocationResponse(context, invocationResult);
     InvocationBatchRequest.Builder nextBatch = getNextBatch();
     if (nextBatch == null) {
-      hasInFlightRpc.clear();
+      // the async request was completed, and there is nothing else in the batch
+      // so we clear the requestState.
+      requestState.clear();
       return;
     }
+    // an async request was just completed, but while it was in flight we have
+    // accumulated a batch, we now proceed with:
+    // a) clearing the batch from our own persisted state (the batch moves to the async operation
+    // state)
+    // b) sending the accumulated batch to the remote function.
+    requestState.set(0);
 
 Review comment:
   So just to sum up 😄 
   I'm trying to clarify the intended backpressuring semantics w.r.t. some of the variable namings here.
   There seems to be some inconsistency in the naming?

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services