mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-07-16 00:16:52 +00:00
Merge pull request #11301 from lifupan/fix_cgroup
runtime-rs: fix the issue of delete cgroup failed
This commit is contained in:
commit
139dc13bdc
@ -123,11 +123,11 @@ impl CgroupsResource {
|
|||||||
/// delete will move the running processes in the cgroup_manager and
|
/// delete will move the running processes in the cgroup_manager and
|
||||||
/// overhead_cgroup_manager to the parent and then delete the cgroups.
|
/// overhead_cgroup_manager to the parent and then delete the cgroups.
|
||||||
pub async fn delete(&self) -> Result<()> {
|
pub async fn delete(&self) -> Result<()> {
|
||||||
for cg_pid in self.cgroup_manager.tasks() {
|
for cg_pid in self.cgroup_manager.procs() {
|
||||||
// For now, we can't guarantee that the thread in cgroup_manager does still
|
// For now, we can't guarantee that the process in cgroup_manager does still
|
||||||
// exist. Once it exit, we should ignore that error returned by remove_task
|
// exist. Once it exit, we should ignore that error returned by remove_task_by_tgid
|
||||||
// to let it go.
|
// to let it go.
|
||||||
if let Err(error) = self.cgroup_manager.remove_task(cg_pid) {
|
if let Err(error) = self.cgroup_manager.remove_task_by_tgid(cg_pid) {
|
||||||
match error.source() {
|
match error.source() {
|
||||||
Some(err) => match err.downcast_ref::<io::Error>() {
|
Some(err) => match err.downcast_ref::<io::Error>() {
|
||||||
Some(e) => {
|
Some(e) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user