-
Notifications
You must be signed in to change notification settings - Fork 72
Fix resource cleanup #1710
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix resource cleanup #1710
Conversation
6225925 to
80312cb
Compare
1bd8d4a to
25c712f
Compare
|
Merging this should close #951 |
5be8401 to
00edc4f
Compare
sondavidb
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to add a unit test? Not sure how useful a mock of this would be though.
|
It appears the changes haven't taken effect. Testing with commit 00edc4f Steps:
nerdctl pull --snapshotter soci example.com/test:soci
Every 1.0s: du -h --max-depth=1 /var/lib/soci-snapshotter-grpc/soci/spancache VM-33-248-tlinux: Wed Nov 5 02:42:00 2025
33M /var/lib/soci-snapshotter-grpc/soci/spancache/1231516239
33M /var/lib/soci-snapshotter-grpc/soci/spancache
nerdctl images -q | xargs nerdctl rmi -fspancache status: Every 1.0s: du -h --max-depth=1 /var/lib/soci-snapshotter-grpc/soci/spancache VM-33-248-tlinux: Wed Nov 5 02:42:16 2025
33M /var/lib/soci-snapshotter-grpc/soci/spancache/1231516239
33M /var/lib/soci-snapshotter-grpc/soci/spancache |
maybe we can use this #1745 |
|
A finalizer is called by golang to clean up the span cache. It is not a deterministic call. So we need to wait for sometime to see the cache getting removed. As a result we dont immediately see a cleanup of the cache. We need to make sure all the raw pointers are released before we evict the span. For testing with nerdctl after you do a cleanup wait for 10~20 seconds to check if the spancache is cleaned up. Also thanks for working on it. Will review your PR. |
Signed-off-by: Shubhranshu Mahapatra <[email protected]>
Signed-off-by: Shubhranshu Mahapatra <[email protected]>
00edc4f to
6e9211c
Compare
|
Pull the image Remove the image Finalizer call, finalizer calls are made async and handled by golang. (To see this log soci-snapshooter needs to be run in debug mode) Cache The case it doesnt handle at the moment is restarts the snapshotter. From my testings the case you are seeing may be a case when we didnt actually wait for the cache to get filled up initially during the test and hence we dont see the cleanup compared to it. @wswsmao |
|
This fix has been addressed by a different PR. |
Issue #, if available:
Description of changes:
TODO:
Testing performed:
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.