container/prune: Don't fail early on layer size errors#52090
container/prune: Don't fail early on layer size errors#52090thaJeztah merged 1 commit intomoby:masterfrom
Conversation
82969f6 to
b062af3
Compare
daemon/prune.go
Outdated
| // Log error as warning, the size is only for informational purposes | ||
| log.G(ctx).Warnf("failed to get layer size for container %s: %v", c.ID, err) |
There was a problem hiding this comment.
Should / can we gate this by a "IsNotFound" check?
Perhaps the remove below as well (but not 100% sure about that one)
There was a problem hiding this comment.
I thought about this and no - the size is just for informational purposes, we should just carry on.
In this case, other errors are probably related to the overall system health/data integrity so they would pop up somewhere else anyway.
There was a problem hiding this comment.
Also for the other one, just because there was issue with one container it shouldn't fail the whole prune operation.
There was a problem hiding this comment.
oh, sorry, meant mostly for the logging; don't print scary warnings if it's an expected situation?
There was a problem hiding this comment.
Yeah perhaps could be a "Debug" log only, but also this shouldn't probably be happening so often...
b062af3 to
6b9ed34
Compare
When ContainerPrune calls GetContainerLayerSize, the container's RW layer snapshot may have already been removed by a concurrent operation. This causes GetContainerLayerSize to return a "rw layer snapshot not found" error, which previously aborted the entire prune operation. The layer size is only calculated for informational purposes so it's not worth failing the whole prune operation anyway. Signed-off-by: Paweł Gronowski <[email protected]>
6b9ed34 to
2ac82f4
Compare
container/prune: Don't fail early on layer size errors
When ContainerPrune calls GetContainerLayerSize, the container's RW layer snapshot may have already been removed by a concurrent operation.
This causes GetContainerLayerSize to return a "rw layer snapshot not found" error, which previously aborted the entire prune operation.
The layer size is only calculated for informational purposes so it's not worth failing the whole prune operation anyway.
- What I did
- How I did it
- How to verify it
- Human readable description for the release notes
- A picture of a cute animal (not mandatory but encouraged)