From: Casey Bodley Date: Thu, 20 Jun 2024 19:56:50 +0000 (-0400) Subject: rgw: config option rgw_asio_assert_yielding X-Git-Tag: v20.0.0~1583^2~2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=5eda1d33530cfa4c3773376c8366e5a66a6682dd;p=ceph.git rgw: config option rgw_asio_assert_yielding enable this to assert on blocking calls that should be asynchronous instead of just logging a warning message Signed-off-by: Casey Bodley --- diff --git a/src/common/options/rgw.yaml.in b/src/common/options/rgw.yaml.in index 5cb7aee81f1e4..84e7413cc3270 100644 --- a/src/common/options/rgw.yaml.in +++ b/src/common/options/rgw.yaml.in @@ -2230,6 +2230,14 @@ options: services: - rgw with_legacy: true +- name: rgw_asio_assert_yielding + type: bool + level: dev + desc: Trigger an assertion failure if an operation would block an asio thread + default: false + services: + - rgw + with_legacy: true - name: rgw_user_quota_bucket_sync_interval type: int level: advanced diff --git a/src/rgw/rgw_asio_thread.cc b/src/rgw/rgw_asio_thread.cc index 83a805fb4093d..a1dfd59e528b2 100644 --- a/src/rgw/rgw_asio_thread.cc +++ b/src/rgw/rgw_asio_thread.cc @@ -17,6 +17,7 @@ #include "common/BackTrace.h" #include "common/dout.h" +#include "include/ceph_assert.h" thread_local bool is_asio_thread = false; @@ -27,6 +28,11 @@ void maybe_warn_about_blocking(const DoutPrefixProvider* dpp) return; } + // for validation, tests can assert that no requests block + const auto& conf = dpp->get_cct()->_conf; + ceph_assert_always(!conf->rgw_asio_assert_yielding); + + // otherwise just log the warning and optional backtrace ldpp_dout(dpp, 20) << "WARNING: blocking librados call" << dendl; #ifdef _BACKTRACE_LOGGING ldpp_dout(dpp, 20) << "BACKTRACE: " << ClibBackTrace(0) << dendl;