We contentedly announce the release of: oslo.service 4.5.0 This release is part of the gazpacho release series. The source is available from: https://opendev.org/openstack/oslo.service Download the package from: https://pypi.org/project/oslo.service Please report issues through: https://bugs.launchpad.net/oslo.service/+bugs For more details, please see below. 4.5.0 ^^^^^ New Features ************ * The oslo.service implements the required signal hanlders when service is launched in the main process. The below signals are captured and their respective handles are called: * "SIGTERM" * "SIGINT" * "SIGHUP" * "SIGALRM" * Added *oslo_service._multiprocessing* module providing "get_spawn_context()" and "get_spawn_pool()" utilities. These enforce the "spawn" start method to avoid fork-inherited lock deadlocks, as explained in: https://pythonspeed.com/articles/python- multiprocessing/ * The threading backend now supports the "spawn" multiprocessing start method. If a service is spawn-safe (picklable), "spawn" will be used as the default start method. Otherwise, the backend will automatically fall back to "fork" if available. This prevents inherited threading locks during worker respawn and improves compatibility with Python 3.12+. For more information about spawn-safe services, see spawn (https://docs.python.org/3/library/multiprocessing.html#contexts- and-start-methods). * Added new "register_service_opts" and "set_service_opts_defaults()" methods that allows OpenStack services to register and override a new default values for the below "service_opts": * "graceful_shutdown_timeout" * "log_options" Bug Fixes ********* * oslo.service SignalHanlder in "Threading" backend execute the signal handlers in a new thread, which does not work because the signal only works in the main thread. This issue has been fixed now by executing the signal handlers in the main thread. * Fixed a bug to launch the multiple workers with different service instance. If the first service instance was picklable the "spawn" multiprocessing context was selected. Any subsequent non-picklable service instance also used the "spawn" multiprocessing context and raised the error. The launcher now re-evaluates the spawn-safe service and if it is not spawn-safe then fallback to "fork" multiprocessing context. See bug 2141304 (https://bugs.launchpad.net/oslo.service/+bug/2141304). * In the threading backend, completed threads were never removed from the group's tracking. Long-lived services that repeatedly add threads could see unbounded growth. Completed threads are now removed when they finish, matching the documented behavior and eventlet. No caller changes needed. Changes in oslo.service 4.4.1..4.5.0 ------------------------------------ 360f1ac Run neutron-ovs-tempest-with-oslo-master job in check pipeline bf701c2 Fix service multiple workers launching different service instance 7c457ff Add register and set method to override the default value for service opts 131c462 Fix ServiceManager singleton race condition in tests 12dbe0b Fix race condition in EventletServerServiceLauncherTest ed7eb80 Fix unbounded growth of thread list in threading backend 325f30c Fix the followup comment from signalhander change 828aed5 Add signal handler for ProcessLauncher with no_fork 39adcef Refactor threading launchers to prefer spawn-safe multiprocessing 2d35d88 Fix race condition while creating the cotyledon.ServiceManager a2082aa Fix signal handler for threading mode 9ca3b4a Delay string interpolations at logging calls 419dcc7 Add multiprocessing utilities with spawn start method db8cde1 Remove reference to tag framework Diffstat (except docs and test files) ------------------------------------- .zuul.yaml | 3 + README.rst | 11 +- oslo_service/_multiprocessing.py | 125 +++++++++++ oslo_service/backend/_threading/service.py | 230 ++++++++++++++++++--- oslo_service/backend/_threading/threadgroup.py | 23 ++- oslo_service/eventlet_backdoor.py | 5 +- oslo_service/opts.py | 43 ++++ pyproject.toml | 2 +- ...-launched-on-main-process-51913add4552949f.yaml | 11 + ...-threading-signal-handler-4b396feab5d75db3.yaml | 7 + ...-unpicklable-second-service-crash-b2141304.yaml | 12 ++ ...rocessing-spawn-utilities-abaeb920e98b692d.yaml | 8 + .../notes/refactor-service-spawn-safe.yaml | 13 ++ .../notes/set_service_opts-fca7a4e8dbd4cdbf.yaml | 9 + ...oup-thread-done-auto-call-e64f74c8cd6c6d3c.yaml | 7 + test-requirements.txt | 2 +- tox.ini | 4 +- 25 files changed, 1113 insertions(+), 67 deletions(-) Requirements updates -------------------- diff --git a/test-requirements.txt b/test-requirements.txt index 2e8bc2b..618fe73 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -7 +7 @@ coverage>=4.0 # Apache-2.0 -cotyledon>=2.0.0 # Apache-2.0 +cotyledon>=2.2.0 # Apache-2.0
participants (1)
-
no-reply@openstack.org