9 using namespace XrdAdaptor;
13 #define FAKE_ERROR_COUNTER 5
16 #define FAKE_ERROR_COUNTER 0
25 std::unique_ptr<XrdCl::AnyObject> response(resp);
26 std::unique_ptr<XrdCl::XRootDStatus>
status(stat);
27 std::shared_ptr<ClientRequest> self_ref = m_self_reference;
28 m_self_reference.reset();
39 XrdCl::ChunkInfo *read_info;
40 response->Get(read_info);
41 m_promise.set_value(read_info->length);
45 XrdCl::VectorReadInfo *read_info;
46 response->Get(read_info);
47 m_promise.set_value(read_info->GetSize());
53 edm::LogWarning(
"XrdAdaptorInternal") <<
"XrdRequestManager::handle(name='"
54 << m_manager.getFilename() <<
") failure when reading from "
55 << (source ? source->
PrettyID() :
"(unknown source)")
56 <<
"; failed with error '" << status->ToStr() <<
"' (errno="
57 << status->errNo <<
", code=" << status->code <<
").";
63 m_manager.requestFailure(self_ref, *status);
68 if (ex.
getCode() == XrdCl::errInvalidResponse)
70 m_promise.set_exception(std::current_exception());
77 ex.
addContext(
"XrdAdaptor::ClientRequest::HandleResponse() failure while running connection recovery");
79 ss <<
"Original error: '" << status->ToStr() <<
"' (errno="
80 << status->errNo <<
", code=" << status->code <<
", source=" << (source ? source->
PrettyID() :
"(unknown source)") <<
").";
82 m_promise.set_exception(std::current_exception());
83 edm::LogWarning(
"XrdAdaptorInternal") <<
"Caught a CMSSW exception when running connection recovery.";
88 ex <<
"XrdRequestManager::handle(name='" << m_manager.getFilename()
89 <<
") failed with error '" << status->ToStr()
90 <<
"' (errno=" << status->errNo <<
", code="
91 << status->code <<
"). Unknown exception occurred when running"
92 <<
" connection recovery.";
93 ex.
addContext(
"Calling XrdRequestManager::handle()");
94 m_manager.addConnections(ex);
96 m_promise.set_exception(std::make_exception_ptr(ex));
97 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
virtual void HandleResponse(XrdCl::XRootDStatus *status, XrdCl::AnyObject *response) override