When we force delete running containers, urunc needs to stop the monitor process and then do the necessary cleanup. However, there is a race condition here. When urunc kills the monitor process it then checks if the process is still running and in the cases the process is still there, urunc returns with an error and can not finish deletion. For the time being, this does not hurt, since containerd will ask again urunc to delete the container and everything will run smoothly the next time. However, we get annoying log messages of failed deletion errors. Also, there have been cases where the state of the container gets deleted and as a result, we can not recover it.
Therefore, we need to fix this and properly handle the force deletion of containers.
When we force delete running containers,
uruncneeds to stop the monitor process and then do the necessary cleanup. However, there is a race condition here. Whenurunckills the monitor process it then checks if the process is still running and in the cases the process is still there,uruncreturns with an error and can not finish deletion. For the time being, this does not hurt, since containerd will ask againuruncto delete the container and everything will run smoothly the next time. However, we get annoying log messages of failed deletion errors. Also, there have been cases where the state of the container gets deleted and as a result, we can not recover it.Therefore, we need to fix this and properly handle the force deletion of containers.