Skip to content

Commit

Permalink
dcache (pool manager): override suspend when "excluded" (hosts) is no…
Browse files Browse the repository at this point in the history
…t empty'

Motivation:

In https://rb.dcache.org/r/11955/
master@261e78639548adadfaea38827c47efe92e1a2f41
we introduced support for the xrootd cgi "tried=<host>,".

In https://rb.dcache.org/r/12387/
master@2231b12e451aaa80240eb54861a965c2468d3a99
we made this an optional feature because this exclusion
can put access to the file into an indefinitely
suspended state for all clients.

In this patch, we address the latter problem
directly.

Modfication:

Set a flag on the basis of whether the set
of excluded hosts is empty or not.

In the case of an attempt to suspend access,
if the flag is true, fail instead.

Result:

When 'tried' is activated (the only time
excluded hosts can be non-empty), failure
to read the file will not put the
request container into the SUSPENDED state.

Target: master
Request: 6.1
Patch: https://rb.dcache.org/r/12400
Requires-notes: yes
Requires-book: no
Acked-by: Dmitry
  • Loading branch information
alrossi committed Jun 15, 2020
1 parent 0132c7a commit b5f1270
Showing 1 changed file with 8 additions and 3 deletions.
Expand Up @@ -25,6 +25,7 @@
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.Set;
import java.util.concurrent.Callable;
import java.util.concurrent.Executor;
import java.util.regex.Pattern;
Expand Down Expand Up @@ -857,7 +858,8 @@ private class PoolRequestHandler {
* Indicates the next time a TTL of a request message will be
* exceeded.
*/
private long _nextTtlTimeout = Long.MAX_VALUE;
private long _nextTtlTimeout = Long.MAX_VALUE;
private boolean _failOnExcluded;

public PoolRequestHandler(PnfsId pnfsId,
String poolGroup,
Expand Down Expand Up @@ -919,11 +921,14 @@ public void addRequest( CellMessage message ){
_destinationFileStatus = ((PoolMgrReplicateFileMsg)request).getDestinationFileStatus() ;
}

Set<String> excluded = request.getExcludedHosts();
_failOnExcluded = excluded != null && !excluded.isEmpty();

_poolSelector =
_poolMonitor.getPoolSelector(_fileAttributes,
_protocolInfo,
_linkGroup,
request.getExcludedHosts());
excluded);
//
//
//
Expand Down Expand Up @@ -1816,7 +1821,7 @@ private void suspend(String status)

private void suspendIfEnabled(String status)
{
if (_onError.equals("suspend")) {
if (_onError.equals("suspend") && !_failOnExcluded) {
suspend(status);
} else {
fail();
Expand Down

0 comments on commit b5f1270

Please sign in to comment.