From 0330031f634b9ee7b59d05276e2cb550994f85a6 Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Thu, 16 Jun 2016 22:51:54 -0400 Subject: [PATCH] rgw: add pipe fd to set for select() in do_curl_wait() when HAVE_CURL_MULTI_WAIT is 0, the pipe fd is never added to the readfds for select(), so FD_ISSET() is always false. this prevents us from ever trying to read from the fd, and the pipe's buffer eventually fills up and deadlocks callers of RGWHTTPManager::signal_thread() when they try to write to the pipe Fixes: http://tracker.ceph.com/issues/16368 Signed-off-by: Casey Bodley (cherry picked from commit 75897f82abde818fde6e1625c6977dcdd639a1f0) --- src/rgw/rgw_http_client.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/rgw/rgw_http_client.cc b/src/rgw/rgw_http_client.cc index 1661dd2f2ba31..1212bb0b8761c 100644 --- a/src/rgw/rgw_http_client.cc +++ b/src/rgw/rgw_http_client.cc @@ -393,8 +393,11 @@ static int do_curl_wait(CephContext *cct, CURLM *handle, int signal_fd) return -EIO; } - if (signal_fd >= maxfd) { - maxfd = signal_fd + 1; + if (signal_fd > 0) { + FD_SET(signal_fd, &fdread); + if (signal_fd >= maxfd) { + maxfd = signal_fd + 1; + } } /* forcing a strict timeout, as the returned fdsets might not reference all fds we wait on */ -- 2.39.5