for (int i = 0; i < thread_count; i++) {
threads.emplace_back([=] {
+ // request warnings on synchronous librados calls in this thread
+ is_asio_thread = true;
boost::system::error_code ec;
context.run(ec);
});
.remove();
}
+thread_local bool is_asio_thread = false;
+
int rgw_rados_operate(librados::IoCtx& ioctx, const std::string& oid,
librados::ObjectReadOperation *op, bufferlist* pbl,
optional_yield y)
}
return -ec.value();
}
+ // work on asio threads should be asynchronous, so warn when they block
+ if (is_asio_thread) {
+ dout(20) << "WARNING: blocking librados call" << dendl;
+ }
#endif
return ioctx.operate(oid, op, nullptr);
}
librados::async_operate(context, ioctx, oid, op, 0, yield[ec]);
return -ec.value();
}
+ if (is_asio_thread) {
+ dout(20) << "WARNING: blocking librados call" << dendl;
+ }
#endif
return ioctx.operate(oid, op);
}
void rgw_filter_attrset(map<string, bufferlist>& unfiltered_attrset, const string& check_prefix,
map<string, bufferlist> *attrset);
+/// indicates whether the current thread is in boost::asio::io_context::run(),
+/// used to log warnings if synchronous librados calls are made
+extern thread_local bool is_asio_thread;
+
/// perform the rados operation, using the yield context when given
int rgw_rados_operate(librados::IoCtx& ioctx, const std::string& oid,
librados::ObjectReadOperation *op, bufferlist* pbl,