Zakelly commented on code in PR #25968:
URL: https://github.com/apache/flink/pull/25968#discussion_r1914191873
##########
flink-runtime/src/main/java/org/apache/flink/runtime/asyncprocessing/AsyncExecutionController.java:
##########
@@ -388,14 +403,13 @@ private void seizeCapacity() {
// 2. If the state request is for a newly entered record, the
in-flight record number should
// be less than the max in-flight record number.
// Note: the currentContext may be updated by {@code
StateFutureFactory#build}.
- if (currentContext.getRecord() != RecordContext.EMPTY_RECORD) {
- // We only drain the records when there is a real record or timer
assigned.
- // Typically, if it is an empty record, this is a derived request
by another request (by
- // initializing a process directly via #asyncProcessWithKey),
meaning that we are in
- // middle of another processing and creating a new one here. If we
block here, there
- // might be a deadlock (current processing waiting here to drain
while draining the
- // current processing).
- // There probably cause the number of records actually run to be
greater than the limit.
+ if (!allowOverdraft) {
+ // We allow a derived request by another request (by initializing
a process directly via
+ // #asyncProcessWithKey, or timer triggering right after a record
processing), meaning
+ // that we are in middle of another processing and creating a new
one here. If we block
+ // here, there might be a deadlock (current processing waiting
here to drain the current
+ // processing, this is a rare case when all the records share the
same key).
+ // This probably cause the number of records actually run to be
greater than the limit.
Review Comment:
I'd keep it `allowOverdraft`. It is easier to understand from the invoker's
perspective. Whether to drain is implementation-related. It can not overdraft
thus it drain.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]