File tree Expand file tree Collapse file tree 3 files changed +8
-6
lines changed Expand file tree Collapse file tree 3 files changed +8
-6
lines changed Original file line number Diff line number Diff line change 1919import functools
2020import multiprocessing
2121import operator
22- import signal
2322import threading
2423import types
2524import uuid
4342from oslo_config import cfg
4443from oslo_db import exception as os_db_exc
4544from oslo_log import log
45+ from oslo_service import service as oslo_service
4646from oslo_utils import timeutils
4747from ovsdbapp .backend .ovs_idl import idlutils
4848
@@ -312,8 +312,9 @@ def _setup_hash_ring(self):
312312 themselves to the hash ring.
313313 """
314314 # Attempt to remove the node from the ring when the worker stops
315+ sh = oslo_service .SignalHandler ()
315316 atexit .register (self ._remove_node_from_hash_ring )
316- signal . signal ( signal . SIGTERM , self ._remove_node_from_hash_ring )
317+ sh . add_handler ( " SIGTERM" , self ._remove_node_from_hash_ring )
317318
318319 admin_context = n_context .get_admin_context ()
319320 if not self ._hash_ring_probe_event .is_set ():
Original file line number Diff line number Diff line change 1313
1414import atexit
1515import queue
16- import signal
1716import threading
1817import traceback
1918import weakref
2423from neutron_lib import context as n_ctx
2524from neutron_lib .db import api as db_api
2625from oslo_log import log as logging
26+ from oslo_service import service
2727
2828from neutron .api .rpc .callbacks import events as rpc_events
2929from neutron .api .rpc .handlers import resources_rpc
3838
3939def _setup_change_handlers_cleanup ():
4040 atexit .register (_ObjectChangeHandler .clean_up )
41- signal .signal (signal .SIGINT , _ObjectChangeHandler .clean_up )
42- signal .signal (signal .SIGTERM , _ObjectChangeHandler .clean_up )
41+ sh = service .SignalHandler ()
42+ sh .add_handler ("SIGINT" , _ObjectChangeHandler .clean_up )
43+ sh .add_handler ("SIGTERM" , _ObjectChangeHandler .clean_up )
4344
4445
4546class _ObjectChangeHandler (object ):
Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ oslo.privsep>=2.3.0 # Apache-2.0
4242oslo.reports >= 1.18.0 # Apache-2.0
4343oslo.rootwrap >= 5.15.0 # Apache-2.0
4444oslo.serialization >= 2.25.0 # Apache-2.0
45- oslo.service >= 2.8.0 # Apache-2.0
45+ oslo.service >= 3.1.2 # Apache-2.0
4646oslo.upgradecheck >= 1.3.0 # Apache-2.0
4747oslo.utils >= 4.8.0 # Apache-2.0
4848oslo.versionedobjects >= 1.35.1 # Apache-2.0
You can’t perform that action at this time.
0 commit comments