Skip to content

Commit

Permalink
Fix model not deploy issue under intensive prediction taskks (#1903) (#…
Browse files Browse the repository at this point in the history
…1930)

Signed-off-by: zane-neo <[email protected]>
(cherry picked from commit 521b880)

Co-authored-by: zane-neo <[email protected]>
  • Loading branch information
opensearch-trigger-bot[bot] and zane-neo authored Jan 26, 2024
1 parent 3d349ff commit e91e3a9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,10 @@ void cleanUpLocalCache(Map<String, Set<String>> runningDeployModelTasks) {
}
for (String taskId : allTaskIds) {
MLTaskCache mlTaskCache = mlTaskManager.getMLTaskCache(taskId);
// Task could be a prediction task, and it could be completed and removed from cache in predict thread during the cleaning up.
if (mlTaskCache == null) {
continue;
}
MLTask mlTask = mlTaskCache.getMlTask();
Instant lastUpdateTime = mlTask.getLastUpdateTime();
Instant now = Instant.now();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public synchronized void add(MLTask mlTask, List<String> workerNodes) {
throw new IllegalArgumentException("Duplicate taskId");
}
taskCaches.put(taskId, new MLTaskCache(mlTask, workerNodes));
log.debug("add ML task to cache " + taskId);
log.debug("add ML task to cache, taskId: {}, taskType: {} ", taskId, mlTask.getTaskType());
}

/**
Expand Down

0 comments on commit e91e3a9

Please sign in to comment.