process did not exit when calling sys.exit with privsep
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
oslo.privsep |
New
|
Undecided
|
Unassigned |
Bug Description
In our product, we found when calling sys.exit using a new thread under privsep, the process did not exit and hang there forever, thus the process became a zombie process.
Monitor did not find the process is dead and not trying to restart it.
node_agent_pri = priv_context_
def priv_context_
_errors = []
if priv_ctx_name is None:
if pyfile is None:
if _errors:
raise Exception(
priv_
return PrivContextPlus
in main.py
@privilege.
def main():
some_logic() <------- call threading.Thread to generate a new thread A here.
A.start():
when something wrong:
sys.exit(1) <--------- here it will not exit and hang for ever.
There is not error logs or exception tracestack when this issue happens