Add creating status to ensure state.json exists when runc kill. by jianghao65536 · Pull Request #4645 · opencontainers/runc (original) (raw)
(This is a continuation of #4535)
Fix 4534
If runc gets killed before it sets the cgroup properties during the container creation process, the cgroup ends up in a frozen state. As a result, subsequent attempts to delete the container using 'runc delete' will fail because the state.json file hasn't been created yet.
I've introduced a 'creatingstate'. It's only used by 'runc delete'. Currently, for the containers that are created, 'Stopped' is still the initial set status. I originally wanted to replace it with 'Creating', but due to the mutual reference between 'parentProcess' and 'Container', it is not easy to implement.
Test cases will be supplemented later。