Skip to content

Commit

Permalink
Document safe cache invalidation in SqlTaskManager
Browse files Browse the repository at this point in the history
  • Loading branch information
findepi committed Jan 21, 2022
1 parent f2c3d1d commit 51f18a1
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,8 @@ void removeOldTasks()
try {
DateTime endTime = taskInfo.getStats().getEndTime();
if (endTime != null && endTime.isBefore(oldestAllowedTask)) {
// The removal here is concurrency safe with respect to any concurrent loads: the cache has no expiration,
// the taskId is in the cache, so there mustn't be an ongoing load.
tasks.asMap().remove(taskId);
}
}
Expand Down

0 comments on commit 51f18a1

Please sign in to comment.