10 using namespace XrdAdaptor;
14 #define FAKE_ERROR_COUNTER 5
17 #define FAKE_ERROR_COUNTER 0
26 std::unique_ptr<XrdCl::AnyObject> response(resp);
27 std::unique_ptr<XrdCl::XRootDStatus>
status(stat);
28 std::shared_ptr<ClientRequest> self_ref = self_reference();
29 m_self_reference =
nullptr;
40 XrdCl::ChunkInfo *read_info;
41 response->Get(read_info);
42 m_promise.set_value(read_info->length);
46 XrdCl::VectorReadInfo *read_info;
47 response->Get(read_info);
48 m_promise.set_value(read_info->GetSize());
54 edm::LogWarning(
"XrdAdaptorInternal") <<
"XrdRequestManager::handle(name='"
55 << m_manager.getFilename() <<
") failure when reading from "
56 << (source ? source->
PrettyID() :
"(unknown source)")
57 <<
"; failed with error '" << status->ToStr() <<
"' (errno="
58 << status->errNo <<
", code=" << status->code <<
").";
64 m_manager.requestFailure(self_ref, *status);
69 if (ex.
getCode() == XrdCl::errInvalidResponse)
71 m_promise.set_exception(std::current_exception());
78 ex.
addContext(
"XrdAdaptor::ClientRequest::HandleResponse() failure while running connection recovery");
80 ss <<
"Original error: '" << status->ToStr() <<
"' (errno="
81 << status->errNo <<
", code=" << status->code <<
", source=" << (source ? source->
PrettyID() :
"(unknown source)") <<
").";
83 m_promise.set_exception(std::current_exception());
84 edm::LogWarning(
"XrdAdaptorInternal") <<
"Caught a CMSSW exception when running connection recovery.";
89 ex <<
"XrdRequestManager::handle(name='" << m_manager.getFilename()
90 <<
") failed with error '" << status->ToStr()
91 <<
"' (errno=" << status->errNo <<
", code="
92 << status->code <<
"). Unknown exception occurred when running"
93 <<
" connection recovery.";
94 ex.
addContext(
"Calling XrdRequestManager::handle()");
95 m_manager.addConnections(ex);
97 m_promise.set_exception(std::make_exception_ptr(ex));
98 edm::LogWarning(
"XrdAdaptorInternal") <<
"Caught a new exception when running connection recovery.";
const std::string & PrettyID() const
void addAdditionalInfo(std::string const &info)
void addContext(std::string const &context)
void swap(QualityMetricWatch &)
#define FAKE_ERROR_COUNTER
static std::string const source
static std::atomic< int > g_fakeError
virtual void HandleResponse(XrdCl::XRootDStatus *status, XrdCl::AnyObject *response) override