OCF scripts should not rely on a 'kill' command exit code, but check proc fs instead
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Fuel for OpenStack |
Fix Committed
|
High
|
Alex Schultz | ||
6.1.x |
Won't Fix
|
High
|
MOS Maintenance | ||
7.0.x |
Won't Fix
|
High
|
MOS Maintenance |
Bug Description
The common case for action stop in OCF scripts for Pacemaker RA is:
1) check, by exit code, if kill (SIGTERM) succeeds
2) issue kill -9, if it wasn't.
But 'kill' always returns 0, if the given PID matched the running process and never checks the process actual state. This can be easily checked, for example:
p=`pidof cron`; sudo kill -STOP $p; sudo kill $p; echo $?; ls /proc/$p; ps -p $p
As a result, a cron will be kept running because it cannot process signals, but kill will report an exit code 0.
That is an issue as it drastically increases the number of undesired SIGKILL cases for stop actions and RA should instead tend to perform them gracefully, if possible. Besides that, for heavy loaded system, it is possible that some process cannot process SIGTERM an instant, ending up being shot in the head with SIGKILL.
The solution is to check the results of kill command against a proc fs instead of its exit code and introduce retries for kill as well. SIGKILL should be issued only in cases then there are no more retries left for graceful termination.
Changed in fuel: | |
assignee: | nobody → Bogdan Dobrelya (bogdando) |
status: | New → Triaged |
importance: | Undecided → Medium |
milestone: | none → 6.1 |
description: | updated |
Changed in fuel: | |
status: | Triaged → In Progress |
Changed in fuel: | |
status: | In Progress → Confirmed |
assignee: | Bogdan Dobrelya (bogdando) → Fuel Library Team (fuel-library) |
Changed in fuel: | |
assignee: | Fuel Library Team (fuel-library) → Dmitry Ilyin (idv1985) |
Changed in fuel: | |
status: | Confirmed → Won't Fix |
status: | Won't Fix → Confirmed |
Changed in fuel: | |
status: | Confirmed → Won't Fix |
no longer affects: | fuel/6.1.x |
tags: | added: qa-agree-7.0 |
no longer affects: | fuel/8.0.x |
Changed in fuel: | |
milestone: | 6.1 → 8.0 |
Changed in fuel: | |
assignee: | Alex Schultz (alex-schultz) → Sergii Golovatiuk (sgolovatiuk) |
Changed in fuel: | |
assignee: | Sergii Golovatiuk (sgolovatiuk) → Alex Schultz (alex-schultz) |
Changed in fuel: | |
assignee: | Alex Schultz (alex-schultz) → Sergii Golovatiuk (sgolovatiuk) |
tags: | added: area-library |
Changed in fuel: | |
assignee: | Sergii Golovatiuk (sgolovatiuk) → Alex Schultz (alex-schultz) |
Changed in fuel: | |
status: | In Progress → Fix Committed |
Related fix proposed to branch: master /review. openstack. org/159188
Review: https:/