]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgwi/beast: stream timer with duration 0 disables timeout 43946/head
authorMark Kogan <mkogan@redhat.com>
Mon, 15 Nov 2021 15:50:49 +0000 (15:50 +0000)
committerCory Snyder <csnyder@iland.com>
Tue, 16 Nov 2021 14:20:25 +0000 (09:20 -0500)
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 <mkogan@redhat.com>
src/rgw/rgw_asio_frontend_timer.h

index e5353ade2ce675d9e8078018b244bf890eb1e3ec..b7d6a63b46f114fb5debdd042138ef5be1b646fe 100644 (file)
@@ -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: