summaryrefslogtreecommitdiff
path: root/src/redis-benchmark.c
diff options
context:
space:
mode:
authoryancz2000 <yancz2000@163.com>2022-10-09 17:17:36 +0800
committerGitHub <noreply@github.com>2022-10-09 12:17:36 +0300
commitfe0550a4a64cb358ca3330784fa0ea18e7aecc2e (patch)
tree1a88447ba171e9cd2bfa2326b5e969b0009b26ba /src/redis-benchmark.c
parent35b3fbd90c2ad2c503c9e3d28bfbffff13099925 (diff)
downloadredis-fe0550a4a64cb358ca3330784fa0ea18e7aecc2e.tar.gz
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%.
Diffstat (limited to 'src/redis-benchmark.c')
-rw-r--r--src/redis-benchmark.c2
1 files changed, 1 insertions, 1 deletions
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");