From fe0550a4a64cb358ca3330784fa0ea18e7aecc2e Mon Sep 17 00:00:00 2001 From: yancz2000 Date: Sun, 9 Oct 2022 17:17:36 +0800 Subject: [PATCH] Fix redis-benchmark hang when it fails to connect to redis (#11366) Forgot to start redis-server when testing performance. When opening the benchmark for testing, it will always be stuck, and the process cpu will reach 100%. --- src/redis-benchmark.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/redis-benchmark.c b/src/redis-benchmark.c index 489a6b3a3..f66e82ae8 100644 --- a/src/redis-benchmark.c +++ b/src/redis-benchmark.c @@ -320,7 +320,7 @@ static redisConfig *getRedisConfig(const char *ip, int port, c = getRedisContext(ip, port, hostsocket); if (c == NULL) { freeRedisConfig(cfg); - return NULL; + exit(1); } redisAppendCommand(c, "CONFIG GET %s", "save"); redisAppendCommand(c, "CONFIG GET %s", "appendonly");