Skip to content

Commit

Permalink
dcache-xroot: modify mkdir to ignore dir exists on make parent option
Browse files Browse the repository at this point in the history
Motivation:

See #7256

`Possible extension for xrootd`

Modification:

Catch the file exists exception and ignore it
when the `createParents` option is true.

Result:

Result conforms to vanilla xroot server.

Target: master
Request: 9.1
Request: 9.0
Request: 8.2
Patch: https://rb.dcache.org/r/14031/
Closes: #7256
Requires-notes: yes
Acked-by: Dmitry
Acked-by: Tigran
  • Loading branch information
alrossi authored and mksahakyan committed Aug 3, 2023
1 parent b8fbec0 commit 37bef13
Showing 1 changed file with 8 additions and 1 deletion.
Expand Up @@ -768,7 +768,14 @@ public void createDirectory(FsPath path,
}

if (createParents) {
pnfsHandler.createDirectories(path);
try {
pnfsHandler.createDirectories(path);
} catch (FileExistsCacheException e) {
/*
* The behavior of the xroot vanilla server is to ignore this error
* for createParents.
*/
}
} else {
pnfsHandler.createPnfsDirectory(path.toString());
}
Expand Down

0 comments on commit 37bef13

Please sign in to comment.