From f6a3a893d974ba51c4018c556602b2d570b47fcf Mon Sep 17 00:00:00 2001 From: Grzegorz Banasiak Date: Mon, 1 Jul 2024 13:42:01 +0200 Subject: [PATCH] Fix cmdline method --- esrally/utils/process.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/esrally/utils/process.py b/esrally/utils/process.py index 0380b79d6..6a283a723 100644 --- a/esrally/utils/process.py +++ b/esrally/utils/process.py @@ -181,7 +181,7 @@ def find_all_other_rally_processes() -> List[psutil.Process]: def redact_cmdline(cmdline: list) -> List[str]: """ - Redact client options in p.cmdline as it contains sensitive information like passwords + Redact client options in cmdline as it contains sensitive information like passwords """ return ["=".join((value.split("=")[0], '"*****"')) if "--client-options" in value else value for value in cmdline] @@ -189,7 +189,9 @@ def redact_cmdline(cmdline: list) -> List[str]: def kill_all(predicate: Callable[[psutil.Process], bool]) -> None: def kill(p: psutil.Process): - logging.getLogger(__name__).info("Killing lingering process with PID [%s] and command line [%s].", p.pid, redact_cmdline(p.cmdline)) + logging.getLogger(__name__).info( + "Killing lingering process with PID [%s] and command line [%s].", p.pid, redact_cmdline(p.cmdline()) + ) p.kill() # wait until process has terminated, at most 3 seconds. Otherwise we might run into race conditions with actor system # sockets that are still open.