Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7998ae5d authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Attempt process kill even if cgroup is already removed" into main am:...

Merge "Attempt process kill even if cgroup is already removed" into main am: b37d7cbe am: d5462260

Original change: https://android-review.googlesource.com/c/platform/system/core/+/2828279



Change-Id: If8b74bb5db6a6909c5ebd2cb7c9fdddb240fac0c
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents fc4f529e d5462260
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -196,11 +196,12 @@ void Service::NotifyStateChange(const std::string& new_state) const {
}

void Service::KillProcessGroup(int signal) {
    // If we've already seen a successful result from killProcessGroup*(), then we have removed
    // the cgroup already and calling these functions a second time will simply result in an error.
    // This is true regardless of which signal was sent.
    // These functions handle their own logging, so no additional logging is needed.
    if (!process_cgroup_empty_) {
    // Always attempt the process kill if process is still running.
    // Cgroup clean up routines are idempotent. It's safe to call
    // killProcessGroup repeatedly. During shutdown, `init` will
    // call this function to send SIGTERM/SIGKILL to all processes.
    // These signals must be sent for a successful shutdown.
    if (!process_cgroup_empty_ || IsRunning()) {
        LOG(INFO) << "Sending signal " << signal << " to service '" << name_ << "' (pid " << pid_
                  << ") process group...";
        int r;