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 committed Jul 28, 2023
1 parent 9e19557 commit ad253a6
Showing 1 changed file with 8 additions and 1 deletion.
Expand Up @@ -774,7 +774,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 ad253a6

Please sign in to comment.