Skip to content

Commit

Permalink
xrootd: Fix classification of uploads
Browse files Browse the repository at this point in the history
Motivation:

We have observed upload failures from Alice jobs. These jobs specify the options
delete, mkpath and retstat, but neither new or open_updt. dCache classifies such
requests as reads and subsequently fails stating that the file does not exist.
Clearly the delete option only makes sense for an upload, thus this is a bug
in dCache.

Modification:

Upgrade xrootd4j and rely on the fixed classification provided by the new version.

Result:

Fixes an xrootd protocol incompatibility that caused uploads to be considered
as downloads.

Target: trunk
Request: 2.14
Request: 2.13
Request: 2.12
Request: 2.11
Request: 2.10
Require-notes: yes
Require-book: no
Acked-by: Paul Millar <paul.millar@desy.de>
Patch: https://rb.dcache.org/r/8932/
(cherry picked from commit ac00962)
(cherry picked from commit c0f8ae6)
  • Loading branch information
gbehrmann committed Jan 15, 2016
1 parent 576cda3 commit 7955b7c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
Expand Up @@ -190,17 +190,11 @@ protected XrootdResponse<OpenRequest> doOnOpen(ChannelHandlerContext ctx, OpenRe
Channel channel = ctx.channel();
InetSocketAddress localAddress = (InetSocketAddress) channel.localAddress();
InetSocketAddress remoteAddress = (InetSocketAddress) channel.remoteAddress();
int options = req.getOptions();

FilePerm neededPerm;
FilePerm neededPerm = req.getRequiredPermission();

if (req.isNew() || req.isReadWrite()) {
if (_isReadOnly) {
throw new XrootdException(kXR_NotAuthorized, "Read-only access");
}
neededPerm = FilePerm.WRITE;
} else {
neededPerm = FilePerm.READ;
if (neededPerm == FilePerm.WRITE && _isReadOnly) {
throw new XrootdException(kXR_NotAuthorized, "Read-only access");
}

_log.info("Opening {} for {}", req.getPath(), neededPerm.xmlText());
Expand All @@ -217,8 +211,8 @@ protected XrootdResponse<OpenRequest> doOnOpen(ChannelHandlerContext ctx, OpenRe
try {
XrootdTransfer transfer;
if (neededPerm == FilePerm.WRITE) {
boolean createDir = (options & kXR_mkpath) == kXR_mkpath;
boolean overwrite = (options & kXR_delete) == kXR_delete;
boolean createDir = req.isMkPath();
boolean overwrite = req.isDelete();

transfer =
_door.write(remoteAddress, createFullPath(req.getPath()), uuid,
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Expand Up @@ -69,7 +69,7 @@
<version.xerces>2.11.0</version.xerces>
<version.jetty>9.2.14.v20151106</version.jetty>
<version.wicket>6.19.0</version.wicket>
<version.xrootd4j>2.1.4</version.xrootd4j>
<version.xrootd4j>2.1.5</version.xrootd4j>
<version.jglobus>2.0.6-rc9.d</version.jglobus>

<!-- BouncyCastle seems to change the naming convention of
Expand Down

0 comments on commit 7955b7c

Please sign in to comment.