From: Adam King Date: Thu, 16 Mar 2023 18:20:48 +0000 (-0400) Subject: mgr/cephadm: pass --timeout to cephadm binary commands X-Git-Tag: v19.0.0~1338^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=00d4203ec60ed42840b1b318af49e4e697bd04f2;p=ceph.git mgr/cephadm: pass --timeout to cephadm binary commands Signed-off-by: Adam King --- diff --git a/src/pybind/mgr/cephadm/module.py b/src/pybind/mgr/cephadm/module.py index 555a405ee5e2..159449fe5822 100644 --- a/src/pybind/mgr/cephadm/module.py +++ b/src/pybind/mgr/cephadm/module.py @@ -472,6 +472,13 @@ class CephadmOrchestrator(orchestrator.Orchestrator, MgrModule, default=False, desc='Enable TLS security for all the monitoring stack daemons' ), + Option( + 'default_cephadm_command_timeout', + type='secs', + default=15 * 60, + desc='Default timeout applied to cephadm commands run directly on ' + 'the host (in seconds)' + ), ] def __init__(self, *args: Any, **kwargs: Any): @@ -554,6 +561,7 @@ class CephadmOrchestrator(orchestrator.Orchestrator, MgrModule, self.device_enhanced_scan = False self.cgroups_split = True self.log_refresh_metadata = False + self.default_cephadm_command_timeout = 0 self.notify(NotifyType.mon_map, None) self.config_notify() diff --git a/src/pybind/mgr/cephadm/serve.py b/src/pybind/mgr/cephadm/serve.py index 3778baa87548..ea8a67590a9e 100644 --- a/src/pybind/mgr/cephadm/serve.py +++ b/src/pybind/mgr/cephadm/serve.py @@ -1421,6 +1421,7 @@ class CephadmServe: image: Optional[str] = "", env_vars: Optional[List[str]] = None, log_output: Optional[bool] = True, + timeout: Optional[int] = None, # timeout in seconds ) -> Tuple[List[str], List[str], int]: """ Run cephadm on the remote host with the given command + args @@ -1459,6 +1460,11 @@ class CephadmServe: if not self.mgr.cgroups_split: final_args += ['--no-cgroups-split'] + if not timeout: + # 15 minute global timeout if no timeout was passed + timeout = self.mgr.default_cephadm_command_timeout + final_args += ['--timeout', str(timeout)] + # subcommand final_args.append(command)