Zakelly commented on code in PR #24667: URL: https://github.com/apache/flink/pull/24667#discussion_r1578825952
########## 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: I mean, the `triggerIfNeeded(false)` may be triggered somewhere else right? And even the `enqueueToActive` has two entry. I'd suggest move the `scheduleTimeout` part into the `StateRequestBuffer`, but the handler and seq maintaining part should stay in `AEC` -- 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