Revert "cgroup: Continue unit reset if cgroup is busy"

LP: #1844879

This reverts commit 0219b3524f414e23589e63c6de6a759811ef8474.
Forwarded: https://github.com/systemd/systemd/issues/13629

Gbp-Pq: Topic debian
Gbp-Pq: Name UBUNTU-Revert-cgroup-Continue-unit-reset-if-cgroup-is-busy.patch
This commit is contained in:
Balint Reczey 2019-09-21 18:53:49 +02:00 committed by liaoxianfu
parent 97f04d4ef2
commit c2d73f4061
1 changed files with 4 additions and 7 deletions

View File

@ -2810,13 +2810,10 @@ void unit_prune_cgroup(Unit *u) {
is_root_slice = unit_has_name(u, SPECIAL_ROOT_SLICE);
r = cg_trim_everywhere(u->manager->cgroup_supported, u->cgroup_path, !is_root_slice);
if (r < 0)
/* One reason we could have failed here is, that the cgroup still contains a process.
* However, if the cgroup becomes removable at a later time, it might be removed when
* the containing slice is stopped. So even if we failed now, this unit shouldn't assume
* that the cgroup is still realized the next time it is started. Do not return early
* on error, continue cleanup. */
log_unit_full_errno(u, r == -EBUSY ? LOG_DEBUG : LOG_WARNING, r, "Failed to destroy cgroup %s, ignoring: %m", empty_to_root(u->cgroup_path));
if (r < 0) {
log_unit_debug_errno(u, r, "Failed to destroy cgroup %s, ignoring: %m", empty_to_root(u->cgroup_path));
return;
}
if (is_root_slice)
return;