Open 2000yeshu opened 1 year ago
I can not reproduce the bug, would you mind giving us more specific reproduce steps?
I have updated the issue description with steps I followed to reproduce the bug.
I feel there should be signal handlers on the commit context so as to delete any garbage keys created by bolt in case a commit was interrupted/failed before completion.
Opened PR in containerd in relation to this
I also encountered the same problem. As long as nerdctl can correctly close the context when receiving the SIGETRM or SIGINT signal, most problems can be solved. In the nerdctl Commit function, if the context is closed, there is a chance to release the Lease.
In addition, the interruption of the commit command will also cause the container that was originally RUNNING to remain in PAUSE, which may also be a problem.
Description
When we commit a contianer and the commit is interrupted and when we retry the commit we see the error failed to export layer: snapshot \"sha256:5ca359d74c4d65ad7dc2fc1013b3cccfa921f9000395ac846fd06a37c9a1a67e-parent-view\": already exists. I think this happens because there is no garbage collection of the bolt KVs and the error is thrown here in containerd's bolt module
Steps to reproduce the issue
Describe the results you received and expected
Recieved: Container stuck in PAUSED state and cannot not be committed in the second attempt.
Expected: Either the container should be successfully committed on second attempt or if not, it should fallback to RUNNING state.
What version of nerdctl are you using?
Client: Version: v0.20.0 OS/Arch: linux/amd64 Git commit: e77e05b5fd252274e3727e0439e9a2d45622ccb9
Server: containerd: Version: 1.6.6 GitCommit: 10c12954828e7c7c9b6e0ea9b0c02b01407d3ae1
What version of ctr are you using?
Client: Version: 1.6.6 Revision: 10c12954828e7c7c9b6e0ea9b0c02b01407d3ae1 Go version: go1.17.11
Are you using a variant of nerdctl? (e.g., Rancher Desktop)
No response
Host information
No response