fredia commented on code in PR #24667:
URL: https://github.com/apache/flink/pull/24667#discussion_r1578997828


##########
flink-runtime/src/main/java/org/apache/flink/runtime/asyncprocessing/AsyncExecutionController.java:
##########
@@ -220,12 +283,17 @@ <IN, OUT> void insertBlockingBuffer(StateRequest<K, IN, 
OUT> request) {
      * @param force whether to trigger requests in force.
      */
     void triggerIfNeeded(boolean force) {
-        // TODO: introduce a timeout mechanism for triggering.
         if (!force && stateRequestsBuffer.activeQueueSize() < batchSize) {
+            // if the active queue size is 1, it means that the current 
request is the oldest one in
+            // the active queue.
+            if (stateRequestsBuffer.activeQueueSize() == 1) {
+                scheduleTimeout(currentTriggerSeq.get());
+            }

Review Comment:
   Currently, `triggerIfNeeded(false)` is only called in `handleRequest()`, I 
added a `schedulingCount==1` condition to avoid "trigger multiple times for one 
seq" in the future.
   
   And I moved `scheduleTimeout ` into `StateRequestBuffer`, thanks for the 
suggestion.👍



-- 
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: issues-unsubscr...@flink.apache.org

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

Reply via email to