Skip to content

Commit

Permalink
rgw: add conditional backtrace logging after "WARNING: blocking libra…
Browse files Browse the repository at this point in the history
…dos call"

Signed-off-by: Ali Maredia <[email protected]>
  • Loading branch information
alimaredia committed Jan 24, 2023
1 parent 3af256f commit 414bdd4
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 4 additions & 0 deletions src/rgw/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
10 changes: 10 additions & 0 deletions src/rgw/driver/rados/rgw_tools.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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);
}
Expand All @@ -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);
}
Expand All @@ -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);
}
Expand Down

0 comments on commit 414bdd4

Please sign in to comment.