]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
manager: systemd: lower unit start timeout to 10 seconds from 30
authorVasek Sraier <git@vakabus.cz>
Mon, 14 Mar 2022 20:14:02 +0000 (21:14 +0100)
committerAleš Mrázek <ales.mrazek@nic.cz>
Fri, 8 Apr 2022 14:17:54 +0000 (16:17 +0200)
This is done after a short discussion on Slack where we've learnt that kresd should be up and running
within fraction of a second.

manager/knot_resolver_manager/kresd_controller/systemd/dbus_api.py

index 51afef52ac509a084a991eb475d9af0c3e922aa7..4f0c0367250636f42084d15d5e8ced301a2ad706 100644 (file)
@@ -55,7 +55,7 @@ def _create_manager_proxy(type_: SystemdType) -> Any:
     return _create_object_proxy(type_, ".systemd1")
 
 
-def _wait_for_job_completion(systemd: Any, job_creating_func: Callable[[], str], timeout_sec: int = 30) -> None:
+def _wait_for_job_completion(systemd: Any, job_creating_func: Callable[[], str], timeout_sec: int = 10) -> None:
     """
     Takes a function returning a systemd job path, executes it while simultaneously waiting
     for its completion. This prevents race conditions.
@@ -251,7 +251,7 @@ def start_transient_kresd_unit(config: KresConfig, type_: SystemdType, kres_id:
         _wait_for_job_completion(systemd, job)
     except SubprocessControllerTimeoutException:
         logger.error(
-            f"Failed to start transient '{name}'." "The start operation did not finish within the expected timeframe"
+            f"Failed to start transient '{name}'. The start operation did not finish within the expected timeframe"
         )
         raise
     except SubprocessControllerException as e: