Client is raising a RuntimeError exception during shutdown

Bug #1878222 reported by Rodolfo Alonso on 2020-05-12
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
oslo.rootwrap
Undecided
Rodolfo Alonso

Bug Description

When the Client is stopped, "Client._shutdown" method is called. This method will call the RootwrapManager "shutdown" method, implemented in multiprocessing.managers.BaseManager.shutdown and this is an instance of multiprocessing.util.Finalize class.

This class will try to stop the root daemon sending a "shutdown" command, using the same socket client. If, by any circumstance, the socket is in use by other thread, the following error will be thrown: http://paste.openstack.org/show/793448/

I suggest to add an active retry/wait loop in this method to ensure that:
- The daemon is correctly stopped; the daemon should receive the command to send the SIGINT signal and stop the process.
- The client should not raise an exception but finish properly.

Changed in oslo.rootwrap:
assignee: nobody → Rodolfo Alonso (rodolfo-alonso-hernandez)

Fix proposed to branch: master
Review: https://review.opendev.org/727800

Changed in oslo.rootwrap:
status: New → In Progress

Reviewed: https://review.opendev.org/727800
Committed: https://git.openstack.org/cgit/openstack/oslo.rootwrap/commit/?id=ee39ce31af7357d335e5e1f8d9eefa3e2f5fe76d
Submitter: Zuul
Branch: master

commit ee39ce31af7357d335e5e1f8d9eefa3e2f5fe76d
Author: Rodolfo Alonso Hernandez <email address hidden>
Date: Wed May 13 15:21:33 2020 +0000

    Avoid raising a RuntimeError during the shutdown

    When the client stops, sends a shutdown command to the root daemon.
    If the socket is still in use, it will return a RuntimeError and
    stop the code execution.

    Instead of this, this exception is now captured and the shutdown
    command re-executed up to 3 times. In case of not succeeding, the
    process will continue the client shutdown.

    Change-Id: I0302b49e38523d6170be407d4563928cfcc3c1a3
    Closes-Bug: #1878222

Changed in oslo.rootwrap:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers