Skip to content

Commit

Permalink
Fix cmdline method
Browse files Browse the repository at this point in the history
  • Loading branch information
gbanasiak committed Jul 1, 2024
1 parent d5a6508 commit f6a3a89
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions esrally/utils/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,15 +181,17 @@ 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]


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.
Expand Down

0 comments on commit f6a3a89

Please sign in to comment.