Skip to content

Commit 1ffaa1e

Browse files
On remote DB spin, logging process exit code and stdout stderr in case of failure (#286)
1 parent bd2a9cc commit 1ffaa1e

File tree

3 files changed

+22
-3
lines changed

3 files changed

+22
-3
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "redisbench-admin"
3-
version = "0.6.19"
3+
version = "0.6.20"
44
description = "Redis benchmark run helper. A wrapper around Redis and Redis Modules benchmark tools ( ftsb_redisearch, memtier_benchmark, redis-benchmark, aibench, etc... )."
55
authors = ["filipecosta90 <[email protected]>","Redis Performance Group <[email protected]>"]
66
readme = "README.md"

redisbench_admin/run/cluster.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,16 @@ def spin_up_redis_cluster_remote_redis(
138138
)
139139
logfiles.append(logfile)
140140
redis_process_commands.append(" ".join(command))
141-
execute_remote_commands(
141+
res = execute_remote_commands(
142142
server_public_ip, username, private_key, redis_process_commands, ssh_port
143143
)
144+
for pos, res_pos in enumerate(res):
145+
[recv_exit_status, stdout, stderr] = res_pos
146+
if recv_exit_status != 0:
147+
logging.error(
148+
"Remote primary shard {} command returned exit code {}. stdout {}. stderr {}".format(
149+
pos, recv_exit_status, stdout, stderr
150+
)
151+
)
152+
144153
return logfiles

redisbench_admin/run_remote/standalone.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,17 @@ def spin_up_standalone_remote_redis(
3737

3838
# start redis-server
3939
commands = [initial_redis_cmd]
40-
execute_remote_commands(server_public_ip, username, private_key, commands, port)
40+
res = execute_remote_commands(
41+
server_public_ip, username, private_key, commands, port
42+
)
43+
for pos, res_pos in enumerate(res):
44+
[recv_exit_status, stdout, stderr] = res_pos
45+
if recv_exit_status != 0:
46+
logging.error(
47+
"Remote primary shard {} command returned exit code {}. stdout {}. stderr {}".format(
48+
pos, recv_exit_status, stdout, stderr
49+
)
50+
)
4151
return full_logfile
4252

4353

0 commit comments

Comments
 (0)