24 std::unique_ptr<XrdCl::AnyObject>
response(resp);
25 std::unique_ptr<XrdCl::XRootDStatus>
status(
stat);
36 XrdCl::ChunkInfo *read_info;
38 if (read_info ==
nullptr) {
40 ex <<
"nullptr returned from response->Get().";
41 ex.addContext(
"XrdAdaptor::ClientRequest::HandleResponse() called.");
42 m_promise.set_exception(std::make_exception_ptr(ex));
45 if (read_info->length == 0) {
48 <<
"\n received a read_info->length = 0 and read_info->offset = " << read_info->offset;
52 XrdCl::VectorReadInfo *read_info;
54 if (read_info ==
nullptr) {
56 ex <<
"nullptr returned from response->Get() from vector read.";
57 ex.addContext(
"XrdAdaptor::ClientRequest::HandleResponse() called.");
58 m_promise.set_exception(std::make_exception_ptr(ex));
61 if (read_info->GetSize() == 0) {
62 edm::LogWarning(
"XrdAdaptorInternal") <<
"XrdAdaptor::ClientRequest::HandleResponse: While reading from\n "
66 m_promise.set_value(read_info->GetSize());
71 <<
"XrdRequestManager::handle(name='" <<
m_manager.
getFilename() <<
") failure when reading from "
72 << (source ? source->
PrettyID() :
"(unknown source)") <<
"; failed with error '" <<
status->ToStr()
73 <<
"' (errno=" <<
status->errNo <<
", code=" <<
status->code <<
").";
80 if (ex.
getCode() == XrdCl::errInvalidResponse) {
81 m_promise.set_exception(std::current_exception());
86 ex.
addContext(
"XrdAdaptor::ClientRequest::HandleResponse() failure while running connection recovery");
88 ss <<
"Original error: '" <<
status->ToStr() <<
"' (errno=" <<
status->errNo <<
", code=" <<
status->code
89 <<
", source=" << (source ? source->
PrettyID() :
"(unknown source)") <<
").";
91 m_promise.set_exception(std::current_exception());
92 edm::LogWarning(
"XrdAdaptorInternal") <<
"Caught a CMSSW exception when running connection recovery.";
96 <<
"' (errno=" <<
status->errNo <<
", code=" <<
status->code <<
"). Unknown exception occurred when running"
97 <<
" connection recovery.";
98 ex.
addContext(
"Calling XrdRequestManager::handle()");
101 m_promise.set_exception(std::make_exception_ptr(ex));
102 edm::LogWarning(
"XrdAdaptorInternal") <<
"Caught a new exception when running connection recovery.";
const std::string & getFilename() const
const std::string & PrettyID() const
edm::propagate_const< std::shared_ptr< ClientRequest > > m_self_reference
edm::propagate_const< std::shared_ptr< XrdReadStatistics > > m_stats
void addConnections(cms::Exception &) const
std::promise< edm::storage::IOSize > m_promise
void addAdditionalInfo(std::string const &info)
std::shared_ptr< ClientRequest const > self_reference() const
void requestFailure(std::shared_ptr< XrdAdaptor::ClientRequest > c_ptr, XrdCl::Status &c_status)
RequestManager & m_manager
void addContext(std::string const &context)
void swap(QualityMetricWatch &)
#define FAKE_ERROR_COUNTER
Log< level::Warning, false > LogWarning
edm::propagate_const< std::shared_ptr< Source > > m_source
static std::string const source
static std::atomic< int > g_fakeError