]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rgw: add conditional backtrace logging after "WARNING: blocking librados call"
authorAli Maredia <amaredia@redhat.com>
Tue, 17 Jan 2023 19:41:13 +0000 (14:41 -0500)
committerAli Maredia <amaredia@redhat.com>
Tue, 24 Jan 2023 19:04:01 +0000 (14:04 -0500)
Signed-off-by: Ali Maredia <amaredia@redhat.com>
CMakeLists.txt
src/rgw/CMakeLists.txt
src/rgw/driver/rados/rgw_tools.cc

index 3aab8c8a4537bb05d9dbdc3d63d5878b4dfaab1c..0724fcf5075f643de75651d7ee8a6be64a642021 100644 (file)
@@ -440,6 +440,7 @@ option(WITH_RADOSGW_MOTR "CORTX-Motr backend for Rados Gateway" OFF)
 option(WITH_RADOSGW_DAOS "DAOS backend for RADOS Gateway" OFF)
 option(WITH_RADOSGW_SELECT_PARQUET "Support for s3 select on parquet objects" ON)
 option(WITH_RADOSGW_ARROW_FLIGHT "Build arrow flight when not using system-provided arrow" OFF)
+option(WITH_RADOSGW_BACKTRACE_LOGGING "Enable backtraces in rgw logs" OFF)
 
 option(WITH_SYSTEM_ARROW "Use system-provided arrow" OFF)
 option(WITH_SYSTEM_UTF8PROC "Use system-provided utf8proc" OFF)
index 3f792bf8e069b5966ae3ccbc3a4f98a69f14dd56..b02cdd0e6c167e68fec2c2fd657ede4329df0489 100644 (file)
@@ -3,6 +3,10 @@ if(NOT GPERF)
   message(FATAL_ERROR "Can't find gperf")
 endif()
 
+if(WITH_RADOSGW_BACKTRACE_LOGGING)
+  add_definitions(-D_BACKTRACE_LOGGING)
+endif(WITH_RADOSGW_BACKTRACE_LOGGING)
+
 if(WITH_RADOSGW_SELECT_PARQUET)
   set(ARROW_LIBRARIES Arrow::Arrow Arrow::Parquet)
   add_definitions(-D_ARROW_EXIST)
index 5a8aefaac3d3136195b627274d6f4fd88147ad4e..22c1b26971c9201570791778f76c2894ef644842 100644 (file)
@@ -10,6 +10,7 @@
 #include "rgw_acl_s3.h"
 #include "rgw_aio_throttle.h"
 #include "rgw_compression.h"
+#include "common/BackTrace.h"
 
 #define dout_subsys ceph_subsys_rgw
 
@@ -182,6 +183,9 @@ int rgw_rados_operate(const DoutPrefixProvider *dpp, librados::IoCtx& ioctx, con
   // work on asio threads should be asynchronous, so warn when they block
   if (is_asio_thread) {
     ldpp_dout(dpp, 20) << "WARNING: blocking librados call" << dendl;
+#ifdef _BACKTRACE_LOGGING
+    ldpp_dout(dpp, 20) << "BACKTRACE: " << __func__ << ": " << ClibBackTrace(0) << dendl;
+#endif
   }
   return ioctx.operate(oid, op, nullptr, flags);
 }
@@ -199,6 +203,9 @@ int rgw_rados_operate(const DoutPrefixProvider *dpp, librados::IoCtx& ioctx, con
   }
   if (is_asio_thread) {
     ldpp_dout(dpp, 20) << "WARNING: blocking librados call" << dendl;
+#ifdef _BACKTRACE_LOGGING
+    ldpp_dout(dpp, 20) << "BACKTRACE: " << __func__ << ": " << ClibBackTrace(0) << dendl;
+#endif
   }
   return ioctx.operate(oid, op, flags);
 }
@@ -220,6 +227,9 @@ int rgw_rados_notify(const DoutPrefixProvider *dpp, librados::IoCtx& ioctx, cons
   }
   if (is_asio_thread) {
     ldpp_dout(dpp, 20) << "WARNING: blocking librados call" << dendl;
+#ifdef _BACKTRACE_LOGGING
+    ldpp_dout(dpp, 20) << "BACKTRACE: " << __func__ << ": " << ClibBackTrace(0) << dendl;
+#endif
   }
   return ioctx.notify2(oid, bl, timeout_ms, pbl);
 }