Skip to content

Commit

Permalink
webdav: fix slow listing
Browse files Browse the repository at this point in the history
Motivation:

Patch b13f6d7 introduced sleep/retry loop
to address mover completion and checksum availability race condition. Unfortunately
this patch caused sever slowdown of list operation

Modification:

Revert "webdav: wait for upload to complete"
This reverts commit b13f6d7.

Result:

WebDAV listing back to normal

Target: trunk
Request: 9.2
Issue: #7500
Patch: https://rb.dcache.org/r/14202/
Acked-by: Lea Morschel
  • Loading branch information
DmitryLitvintsev authored and mksahakyan committed Jan 24, 2024
1 parent 2d73d8b commit da22a29
Showing 1 changed file with 2 additions and 21 deletions.
Expand Up @@ -632,27 +632,8 @@ public DcacheResource getResource(FsPath path) {
PnfsHandler pnfs = roleAwarePnfsHandler();
Set<FileAttribute> requestedAttributes =
buildRequestedAttributes();
FileAttributes attributes;

// FIXME: work around race condition between http mover completion and HEAD request by FTS
// See: https://rt.dcache.org/Ticket/Display.html?id=10510
int retry = 10;
do {
attributes = pnfs.getFileAttributes(path.toString(), requestedAttributes);
if (!requestedAttributes.contains(CHECKSUM) ||
(attributes.isDefined(CHECKSUM) && !attributes.getChecksums().isEmpty())) {
break;
}
LOGGER.debug("The checksum attribute is not available yet. Waiting ... ({} attempts left)", retry);
retry--;
try {
MILLISECONDS.sleep(500);
} catch (InterruptedException e) {
// Probably shutdown...
break;
}
} while (retry > 0);

FileAttributes attributes =
pnfs.getFileAttributes(path.toString(), requestedAttributes);
return getResource(path, attributes);
} catch (FileNotFoundCacheException e) {
if (haveRetried) {
Expand Down

0 comments on commit da22a29

Please sign in to comment.