Skip to content

Commit 62ea943

Browse files
authored
Merge pull request #47432 from makortel/xrdAdaptorNoEmptyExcludeString
XrdAdaptor: Do not add empty exclude strings
2 parents 5cacea5 + 945a095 commit 62ea943

File tree

2 files changed

+23
-2
lines changed

2 files changed

+23
-2
lines changed

Utilities/XrdAdaptor/src/XrdRequestManager.cc

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,9 @@ void RequestManager::initialize(std::weak_ptr<RequestManager> self) {
255255
}
256256
if (!dataServer.empty()) {
257257
m_disabledSourceStrings.insert(dataServer);
258-
m_disabledExcludeStrings.insert(excludeString);
258+
if (not excludeString.empty()) {
259+
m_disabledExcludeStrings.insert(excludeString);
260+
}
259261
}
260262
// In this case, we didn't go anywhere - we stayed at the redirector and it gave us a file-not-found.
261263
if (lastUrl == new_filename) {
@@ -835,7 +837,9 @@ void RequestManager::requestFailure(std::shared_ptr<XrdAdaptor::ClientRequest> c
835837
// function may be called from within XrdCl::ResponseHandler::HandleResponseWithHosts
836838
// In such a case, if you close a file in the handler, it will deadlock
837839
m_disabledSourceStrings.insert(source_ptr->ID());
838-
m_disabledExcludeStrings.insert(source_ptr->ExcludeID());
840+
if (auto const &eid = source_ptr->ExcludeID(); not eid.empty()) {
841+
m_disabledExcludeStrings.insert(eid);
842+
}
839843
m_disabledSources.insert(source_ptr);
840844

841845
std::unique_lock<std::recursive_mutex> sentry(m_source_mutex);

Utilities/XrdAdaptor/src/XrdSource.cc

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,23 @@ void Source::determineHostExcludeString(XrdCl::File &file, const XrdCl::HostList
293293
// We assume this is a federation context if there's at least a regional, dCache door,
294294
// and dCache pool server (so, more than 2 servers!).
295295

296+
// Further explanation of the motivation from recollections of Brian Bockelman
297+
// 1. The way dCache sites are (were?) integrated into AAA they
298+
// required a standalone server, separate from dCache itself,
299+
// that would advertise file availability (via running the cmsd
300+
// component).
301+
// 2. When a file-open failed for a dCache "pool" (the disk server
302+
// itself), adding the pool name to the exclude list was useless
303+
// because the client was subsequently redirected to server in
304+
// item (1) which, unlike native XRootD solutions, was not aware
305+
// of what pool the client would land on (i.e., it didn't know it
306+
// would redirect again to the same bad pool).
307+
// 3. So, the code had to take an informed guess as to which the
308+
// site integration server (item 1) was by walking up the list of
309+
// redirects and try to hit the first native XRootD source.
310+
// That's what the heuristic in
311+
// Source::determineHostExcludeString is trying to do.
312+
296313
exclude = "";
297314
if (hostList && (hostList->size() > 3) && isDCachePool(file, hostList)) {
298315
const XrdCl::HostInfo &info = (*hostList)[hostList->size() - 3];

0 commit comments

Comments
 (0)