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: v17.2.7~363^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=137bd6bb57259376ef0419731c26782d09dd1d2f;p=ceph.git mgr/cephadm: pass --timeout to cephadm binary commands Signed-off-by: Adam King (cherry picked from commit 00d4203ec60ed42840b1b318af49e4e697bd04f2) --- diff --git a/src/pybind/mgr/cephadm/module.py b/src/pybind/mgr/cephadm/module.py index e5e5a8eebb94..c020b87600a9 100644 --- a/src/pybind/mgr/cephadm/module.py +++ b/src/pybind/mgr/cephadm/module.py @@ -407,6 +407,13 @@ class CephadmOrchestrator(orchestrator.Orchestrator, MgrModule, default=False, desc='Log all refresh metadata. Includes daemon, device, and host info collected regularly. Only has effect if logging at debug level' ), + 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): @@ -479,6 +486,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 0c6a0b208d32..6d5e0cd0f3f9 100644 --- a/src/pybind/mgr/cephadm/serve.py +++ b/src/pybind/mgr/cephadm/serve.py @@ -1381,6 +1381,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 @@ -1419,6 +1420,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)