From 29cb32539e67f45f9bd2cfa19042a94266414f3e Mon Sep 17 00:00:00 2001 From: dHannasch Date: Tue, 10 Nov 2020 19:22:10 -0700 Subject: [PATCH] [Core] If failed to connect to redis, try to say why. (#11916) --- src/ray/gcs/redis_context.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/ray/gcs/redis_context.cc b/src/ray/gcs/redis_context.cc index 8f6a157ef..f4efa423f 100644 --- a/src/ray/gcs/redis_context.cc +++ b/src/ray/gcs/redis_context.cc @@ -301,7 +301,14 @@ Status ConnectWithRetries(const std::string &address, int port, } break; } - RAY_LOG(WARNING) << "Failed to connect to Redis, retrying."; + if (*context == nullptr) { + RAY_LOG(WARNING) << "Could not allocate Redis context, retrying."; + } + if ((*context)->err) { + RAY_LOG(WARNING) << "Could not establish connection to Redis " << address << ":" + << port << " (context.err = " << (*context)->err << ")" + << ", retrying."; + } // Sleep for a little. std::this_thread::sleep_for(std::chrono::milliseconds( RayConfig::instance().redis_db_connect_wait_milliseconds()));