From c0c1dc389cc7ae76a5874a36a8fa12845a7a6af5 Mon Sep 17 00:00:00 2001 From: Mark Kogan Date: Mon, 15 Nov 2021 15:50:49 +0000 Subject: [PATCH] rgwi/beast: stream timer with duration 0 disables timeout fixes all S3 operations failing with: `2021-11-15T15:46:05.992+0000 7ffee17fa700 20 failed to read header: Bad file descriptor` when `--rgw_frontends="beast port=8000 request_timeout_ms=0"` Signed-off-by: Mark Kogan --- src/rgw/rgw_asio_frontend_timer.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/rgw/rgw_asio_frontend_timer.h b/src/rgw/rgw_asio_frontend_timer.h index e5353ade2ce6..b7d6a63b46f1 100644 --- a/src/rgw/rgw_asio_frontend_timer.h +++ b/src/rgw/rgw_asio_frontend_timer.h @@ -42,12 +42,16 @@ class basic_timeout_timer { basic_timeout_timer& operator=(const basic_timeout_timer&) = delete; void start() { - timer.expires_after(dur); - timer.async_wait(timeout_handler{stream}); + if (dur.count() > 0) { + timer.expires_after(dur); + timer.async_wait(timeout_handler{stream}); + } } void cancel() { - timer.cancel(); + if (dur.count() > 0) { + timer.cancel(); + } } private: -- 2.47.3