Risk of zombie subprocess when running playbooks in sysinv

Bug #1990547 reported by Joshua Kraitberg
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
StarlingX
Confirmed
Low
Joshua Kraitberg

Bug Description

Brief Description
-----------------
A robustness improvement to mitigate the potential of zombie subprocesses in sysinv.

Severity
--------
Minor

Steps to Reproduce
------------------
A number of run_playbook calls are issued within sysinv, such as on sysinv-conductor startup.

Expected Behavior
------------------
No zombie subprocesses

Actual Behavior
----------------
Chance of zombie subprocesses if killed at correct time

Reproducibility
---------------
100% if sysinv is killed while a playbook is running inside a subprocess

System Configuration
--------------------
N/A

Branch/Pull Time/Commit
-----------------------
N/A

Last Pass
---------
N/A

Timestamp/Logs
--------------
N/A

Test Activity
-------------
Developer Testing

Workaround
----------
Use a helper function like subprocess.run or use Popen inside a context manager. "with subprocess.Popen".

Tags: stx.config
Changed in starlingx:
assignee: nobody → Joshua Kraitberg (jkraitbe-wr)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to config (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/starlingx/config/+/859086

Changed in starlingx:
status: New → In Progress
Ghada Khalil (gkhalil)
Changed in starlingx:
importance: Undecided → Low
tags: added: stx.config
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to config (master)

Reviewed: https://review.opendev.org/c/starlingx/config/+/859086
Committed: https://opendev.org/starlingx/config/commit/a6b9390179433126192054084f5360f57a27310e
Submitter: "Zuul (22348)"
Branch: master

commit a6b9390179433126192054084f5360f57a27310e
Author: Joshua Kraitberg <email address hidden>
Date: Thu Sep 22 11:21:15 2022 -0400

    Replace unsafe Popen when executing playbooks

    If the sysinv process is killed while a playbook is executing
    in a subprocess that was created with this Popen, it will become
    a zombie.

    By replacing Popen with run, the aforementioned risk is mitigated
    because of the builtin context management and process reaping.

    TEST PLAN
    PASS: Reboot a deployed system (SX/DX), normal operations expected

    Closes-Bug: 1990547
    Signed-off-by: Joshua Kraitberg <email address hidden>
    Change-Id: I1c73ae01e4fa0d61fe774607b7438480470b096c

Changed in starlingx:
status: In Progress → Fix Released
Revision history for this message
Ghada Khalil (gkhalil) wrote :

This code was reverted via this review: https://review.opendev.org/c/starlingx/config/+/861617

Changed in starlingx:
status: Fix Released → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.