Skip to content

Commit

Permalink
dcache-bulk: make sure LINK types are handled when refetched from pre…
Browse files Browse the repository at this point in the history
…stored targets

Motivation:

Symlinks are handled like files (they are not followed
recursively) when expanding a directory.  Symlinks
are also treated implicitly when the request uses
`-prestore=false`.  However, links are not being
retrieved along with files when `-prestore=true`.
This causes the latter type of request not to
complete if there are symlinks encountered anywhere
on its path tree.

Modification:

Check for `LINK` on `next()` after all `FILE`
types are processed.

Result:

Links are handled as they should be and
the requests complete.

Target: master
Request: 8.2
Requires-notes: yes
Patch: https://rb.dcache.org/r/13827/
Acked-by: Tigran
  • Loading branch information
alrossi committed Jan 9, 2023
1 parent 2213544 commit e4d8b4e
Showing 1 changed file with 17 additions and 0 deletions.
Expand Up @@ -170,6 +170,23 @@ protected void processFileTargets() throws InterruptedException {
LOGGER.error("run {}, error getting next file target: {}.", rid, e.toString());
}
}

/*
* Make sure LINK types are handled like files, since we allow them
* on expansion, but also from initial targets.
*/
while (true) {
try {
checkForRequestCancellation();
target = next(FileType.LINK);
if (target.isEmpty()) {
break;
}
perform(target.get());
} catch (BulkStorageException e) {
LOGGER.error("run {}, error getting next file target: {}.", rid, e.toString());
}
}
}

@Override
Expand Down

0 comments on commit e4d8b4e

Please sign in to comment.