Skip to content

Commit 345ae39

Browse files
Fix critical bugs in pubsub-sub-bench integration
Bug Fixes: 1. Fixed UnboundLocalError: 'is_multiple_clients' referenced before assignment - Removed duplicate/misplaced code block that used is_multiple_clients before definition - Ensured proper code flow in process_self_contained_coordinator_stream() 2. Fixed TypeError: argument of type 'NoneType' is not iterable - Added null check in delete_temporary_files() for benchmark_tool_global - Changed: if 'redis-benchmark' in benchmark_tool_global - To: if benchmark_tool_global and 'redis-benchmark' in benchmark_tool_global Testing: - All 5 pubsub-sub-bench tests continue to pass - Successfully tested mixed workload execution: * memtier_benchmark doing PUBLISH commands * pubsub-sub-bench doing SUBSCRIBE commands * Both tools running simultaneously with proper parameter preparation The runner now correctly handles mixed pub/sub workloads without crashes.
1 parent 8d7cb2d commit 345ae39

File tree

3 files changed

+2
-99
lines changed

3 files changed

+2
-99
lines changed

redis_benchmarks_specification/__runner__/runner.py

Lines changed: 1 addition & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -641,7 +641,7 @@ def delete_temporary_files(
641641
if preserve_temporary_client_dirs is True:
642642
logging.info(f"Preserving temporary client dir {temporary_dir_client}")
643643
else:
644-
if "redis-benchmark" in benchmark_tool_global:
644+
if benchmark_tool_global and "redis-benchmark" in benchmark_tool_global:
645645
if full_result_path is not None:
646646
os.remove(full_result_path)
647647
logging.info("Removing temporary JSON file")
@@ -988,76 +988,6 @@ def delete_temporary_files(
988988
)
989989
arbitrary_command = False
990990

991-
# Handle multiple client configurations
992-
if is_multiple_clients:
993-
# Use the new multiple client runner
994-
logging.info("Preparing multiple client configurations")
995-
# We'll handle benchmark preparation inside run_multiple_clients
996-
benchmark_command_str = "multiple_clients" # Placeholder
997-
else:
998-
# Legacy single client preparation
999-
if "memtier_benchmark" in benchmark_tool:
1000-
(
1001-
_,
1002-
benchmark_command_str,
1003-
arbitrary_command,
1004-
) = prepare_memtier_benchmark_parameters(
1005-
benchmark_config["clientconfig"],
1006-
full_benchmark_path,
1007-
port,
1008-
host,
1009-
password,
1010-
local_benchmark_output_filename,
1011-
oss_cluster_api_enabled,
1012-
tls_enabled,
1013-
tls_skip_verify,
1014-
test_tls_cert,
1015-
test_tls_key,
1016-
test_tls_cacert,
1017-
resp_version,
1018-
override_memtier_test_time,
1019-
override_test_runs,
1020-
unix_socket,
1021-
)
1022-
elif "pubsub-sub-bench" in benchmark_tool:
1023-
(
1024-
_,
1025-
benchmark_command_str,
1026-
arbitrary_command,
1027-
) = prepare_pubsub_sub_bench_parameters(
1028-
benchmark_config["clientconfig"],
1029-
full_benchmark_path,
1030-
port,
1031-
host,
1032-
password,
1033-
local_benchmark_output_filename,
1034-
oss_cluster_api_enabled,
1035-
tls_enabled,
1036-
tls_skip_verify,
1037-
test_tls_cert,
1038-
test_tls_key,
1039-
test_tls_cacert,
1040-
resp_version,
1041-
override_memtier_test_time,
1042-
unix_socket,
1043-
None, # username - could be extracted from config if needed
1044-
)
1045-
else:
1046-
# prepare the benchmark command for other tools
1047-
(
1048-
benchmark_command,
1049-
benchmark_command_str,
1050-
) = prepare_benchmark_parameters(
1051-
benchmark_config,
1052-
full_benchmark_path,
1053-
port,
1054-
host,
1055-
local_benchmark_output_filename,
1056-
False,
1057-
benchmark_tool_workdir,
1058-
False,
1059-
)
1060-
1061991
if (
1062992
arbitrary_command
1063993
and oss_cluster_api_enabled

redis_benchmarks_specification/test-suites/pubsub-mixed-workload-example.yml renamed to redis_benchmarks_specification/test-suites/memtier_benchmark-nokeys-pubsub-mixed-100-channels-128B-40-publishers-5-subscribers.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
version: 0.4
2-
name: pubsub-mixed-workload-memtier-publish-pubsub-subscribe
2+
name: memtier_benchmark-nokeys-pubsub-mixed-100-channels-128B-40-publishers-5-subscribers
33
description: Mixed workload with memtier publishing messages and pubsub-sub-bench subscribing to channels simultaneously.
44
dbconfig:
55
configuration-parameters:

redis_benchmarks_specification/test-suites/pubsub-sub-bench-example.yml

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)