SteNicholas commented on code in PR #3099:
URL: https://github.com/apache/celeborn/pull/3099#discussion_r1973059436
##########
worker/src/main/java/org/apache/celeborn/service/deploy/worker/memory/MemoryManager.java:
##########
@@ -599,15 +602,32 @@ private void resumeByPinnedMemory(ServingState
servingState) {
}
}
- private boolean canResumeByPinnedMemory() {
- if (pinnedMemoryCheckEnabled
- && System.currentTimeMillis() - pinnedMemoryLastCheckTime >=
pinnedMemoryCheckInterval
- && getPinnedMemory() / (double) (maxDirectMemory) <
pinnedMemoryResumeRatio) {
- pinnedMemoryLastCheckTime = System.currentTimeMillis();
- return true;
- } else {
+ private boolean tryResumeByPinnedMemory(ServingState currentState,
ServingState lastState) {
+ boolean success = false;
Review Comment:
```suggestion
if (pinnedMemoryCheckEnabled) {
long currentTime = System.currentTimeMillis();
if (currentTime - pinnedMemoryLastCheckTime >=
pinnedMemoryCheckInterval) {
if (getPinnedMemory() / (double) (maxDirectMemory) <
pinnedMemoryResumeRatio) {
pinnedMemoryLastCheckTime = currentTime;
resumingByPinnedMemory = true;
resumeByPinnedMemory(currentState);
return true;
}
} else {
if (resumingByPinnedMemory
&& lastState != ServingState.NONE_PAUSED
&& getPinnedMemory() / (double) (maxDirectMemory) <
pinnedMemoryResumeRatio) {
// do nothing, keep resume for a while
logger.info(
"currentState: {}, keep resume for {}ms after last
resumeByPinnedMemory",
currentState,
currentTime - pinnedMemoryLastCheckTime);
return true;
}
}
}
return false;
```
--
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]