mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-07-31 23:36:12 +00:00
runtime-rs: fix ctr exit failed
During use, there will be cases where the container is in the stop state and get another stop. In this case, the second stop needs to be ignored. Fixes: #4683 Signed-off-by: Quanwei Zhou <quanweiZhou@linux.alibaba.com>
This commit is contained in:
parent
9f49f7adca
commit
cebbebbe8a
@ -193,7 +193,13 @@ impl ContainerInner {
|
||||
) -> Result<()> {
|
||||
let logger = logger_with_process(process);
|
||||
info!(logger, "begin to stop process");
|
||||
|
||||
// do not stop again when state stopped, may cause multi cleanup resource
|
||||
let state = self.init_process.get_status().await;
|
||||
if state == ProcessStatus::Stopped {
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
self.check_state(vec![ProcessStatus::Running])
|
||||
.await
|
||||
.context("check state")?;
|
||||
|
Loading…
Reference in New Issue
Block a user