reswqa commented on code in PR #22084:
URL: https://github.com/apache/flink/pull/22084#discussion_r1146504412
##########
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/buffer/LocalBufferPool.java:
##########
@@ -503,12 +508,11 @@ private void onGlobalPoolAvailable() {
mayNotifyAvailable(toNotify);
}
+ @GuardedBy("availableMemorySegments")
private boolean shouldBeAvailable() {
assert Thread.holdsLock(availableMemorySegments);
- return !availableMemorySegments.isEmpty()
- && unavailableSubpartitionsCount == 0
- && numberOfRequestedOverdraftMemorySegments == 0;
+ return !availableMemorySegments.isEmpty() &&
unavailableSubpartitionsCount == 0;
Review Comment:
Thanks @akalash for the timely feedback.
It makes sense to remove `numberOfRequestedOverdraftMemorySegments == 0` in
another PR. Have to say, I like your suggestion about refactoring this class as
the current logic looks bloated and a little confusing. Once we can sort out
the relationship between these concepts, it can also help us understand whether
we need to keep `numberOfRequestedOverdraftMemorySegments == 0`.
I will keep this condition in this PR to fix this bug first and take a
closer look at whether it's necessary to remove it when the refactoring is
complete.
--
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]