Skip to content

Commit

Permalink
pool: Fix xrootd vector read limits
Browse files Browse the repository at this point in the history
Fixes a bug that caused problems with ROOT 6: dCache provided
too large limits for the readv_ior_max and readv_iov_max
properties.

Target: trunk
Request: 2.10
Request: 2.9
Request: 2.8
Request: 2.7
Request: 2.6
Ticket: http://rt.dcache.org/Ticket/Display.html?id=8461
Require-notes: ues
Require-book: no
Acked-by: Paul Millar <paul.millar@desy.de>
Patch: https://rb.dcache.org/r/7313/
(cherry picked from commit 92b3668)
  • Loading branch information
gbehrmann committed Oct 1, 2014
1 parent fa23ae2 commit b4d77a9
Showing 1 changed file with 7 additions and 2 deletions.
Expand Up @@ -96,6 +96,11 @@ public class XrootdPoolRequestHandler extends AbstractXrootdRequestHandler
private static final int DEFAULT_FILESTATUS_FLAGS = 0;
private static final int DEFAULT_FILESTATUS_MODTIME = 0;

private static final int MAX_JAVA_ARRAY = Integer.MAX_VALUE - 5;
private static final int READV_HEADER_LENGTH = 24;
private static final int READV_ELEMENT_LENGTH = 12;
private static final int READV_IOV_MAX = (MAX_JAVA_ARRAY - READV_HEADER_LENGTH) / READV_ELEMENT_LENGTH;

/**
* Store file descriptors of open files.
*/
Expand Down Expand Up @@ -557,10 +562,10 @@ protected Object doOnQuery(ChannelHandlerContext ctx, MessageEvent event, QueryR
s.append(0);
break;
case "readv_ior_max":
s.append(_server.getMaxFrameSize());
s.append(_server.getMaxFrameSize() - ReadResponse.READ_LIST_HEADER_SIZE);
break;
case "readv_iov_max":
s.append(Integer.MAX_VALUE);
s.append(READV_IOV_MAX);
break;
case "version":
s.append("dCache ").append(Version.of(XrootdPoolRequestHandler.class).getVersion());
Expand Down

0 comments on commit b4d77a9

Please sign in to comment.