Fix singleprocess launcher compatibility with oslo.service 4.4+

The combined Ironic service was passing the no_fork parameter
to ServiceLauncher, which was wrongly mapped to ProcessLauncher [1]

Switch to ProcessLauncher which properly supports no_fork since
oslo.service 4.2.0. This ensures VNC signal handling works correctly
and matches the pattern used by other Ironic services.

[1] 0dfdf810ac

Change-Id: Iea150a5c3f147b7e4f8a778510bfc061a14f289a
Signed-off-by: Riccardo Pittau <elfosardo@gmail.com>
This commit is contained in:
Riccardo Pittau
2025-11-20 12:11:45 +01:00
parent e75c8a4483
commit 09383bc657
2 changed files with 16 additions and 6 deletions
+3 -6
View File
@@ -14,7 +14,6 @@ import sys
from oslo_config import cfg
from oslo_log import log
from oslo_service import service
from ironic.command import conductor as conductor_cmd
from ironic.command import utils
@@ -39,11 +38,9 @@ def main():
# Parse config file and command line options, then start logging
ironic_service.prepare_service('ironic', sys.argv)
# Choose the launcher based upon if vnc is enabled or not.
# The VNC proxy has to be run in the parent process, not
# a sub-process.
launcher = service.ServiceLauncher(CONF, restart_method='mutate',
no_fork=CONF.vnc.enabled)
# The VNC proxy has to be run in the parent process (no_fork=True) for
# signal handling, otherwise forking is fine (no_fork=False, default).
launcher = ironic_service.process_launcher(no_fork=CONF.vnc.enabled)
mgr = rpc_service.RPCService(CONF.host,
'ironic.conductor.manager',
@@ -0,0 +1,13 @@
---
fixes:
- |
Fixes compatibility with oslo.service versions 4.4.0 and later. The
combined Ironic service (``ironic`` command) was passing the ``no_fork``
parameter to ``ServiceLauncher``, which worked in oslo.service <= 4.3.0
because ``ServiceLauncher`` was mapped to ``ProcessLauncher`` (which
supports ``no_fork``). In oslo.service 4.4.0, this mapping was changed
and ``ServiceLauncher`` became a distinct class that doesn't accept
``no_fork``, causing ``TypeError`` when starting the service. The code
now directly uses ``ProcessLauncher`` via ``process_launcher()``, which
properly supports ``no_fork`` and ensures VNC signal handling works
correctly when ``[vnc]enabled=True``.