Skip to content

Commit

Permalink
Removing the duplicate process check based on truncated name and rely…
Browse files Browse the repository at this point in the history
…ing on cmdline check

On linux, the process name is truncated to 15 characters and hence it matches both
opensearch-benchmark and opensearch-benchmarkd. This results in killing the daemon
process and breaks the distributed run setup. Removing the name based check on the
truncated name and relying on command line which provides the full command.

Keeping the name based check on full name as is.

Signed-off-by: Prabhakar Sithanandam <[email protected]>
  • Loading branch information
backslasht committed Jun 15, 2024
1 parent 92bf0b9 commit 6ece3d6
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions osbenchmark/utils/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,7 @@ def run_subprocess_with_logging(command_line, header=None, level=logging.INFO, s

def is_benchmark_process(p):
cmdline = p.cmdline()
# On Linux, /proc/PID/status truncates the command name to 15 characters which matches both opensearch-benchmark
# and opensearch-benchmarkd. Hence, checking command line to exclude opensearch-benchmarkd process.
return p.name() == "opensearch-benchmark" or \
(p.name() == "opensearch-benc" and
len(cmdline) > 1 and
os.path.basename(cmdline[1]) != "opensearch-benchmarkd") or \
(len(cmdline) > 1 and
os.path.basename(cmdline[0].lower()).startswith("python") and
os.path.basename(cmdline[1]) == "opensearch-benchmark")
Expand Down

0 comments on commit 6ece3d6

Please sign in to comment.