pleg: ensure the cache is updated whenever container are removed#22117
pleg: ensure the cache is updated whenever container are removed#22117yujuhong wants to merge 1 commit into
Conversation
Even though we don't rely on the cache for garbage collection yet, we should keep it up-to-date.
|
This doesn't affect correctness, but pleg may accumulate more removed containers internally over time. |
|
Labelling this PR as size/S |
|
GCE e2e build/test passed for commit 3923695. |
|
GCE e2e build/test passed for commit 3923695. |
| // need to do it again. | ||
| return nil | ||
| // We already reported that the container died before. | ||
| return &PodLifecycleEvent{ID: podID, Type: ContainerRemoved, Data: cid} |
There was a problem hiding this comment.
@yujuhong There is a bug in the old implementation.
If generateEvent returns nil here, the corresponding podRecord will never be removed in the following loop. This seems to be a memory leak.
There was a problem hiding this comment.
@yujuhong Just saw your comment above. I think we are talking about the same thing, right? :)
This doesn't affect correctness, but pleg may accumulate more removed containers internally over time.
|
LGTM |
|
@k8s-bot test this Tests are more than 48 hours old. Re-running tests. |
|
GCE e2e build/test passed for commit 3923695. |
|
Closing since the commit has been merged as part of #22155 |
|
SGTM |
Even though we don't rely on the cache for garbage collection yet, we should
keep it up-to-date.