Skip to content

Commit

Permalink
pool: show the listen port of nfs mover with admin info command
Browse files Browse the repository at this point in the history
Motivation:
For debugging it's not always trivial to discover NFS mover port number,
especially then there are many pools on the host. Obviously, pool knows
has this information and can display, if asked.

Modification:
Update NfsTransferService to provide the listen port by `getInfo()` cell
command.

Result:
simple way to discover nfs mover port number.

Acked-by: Paul Millar
Target: master
Require-book: no
Require-notes: yes
  • Loading branch information
kofemann committed Aug 10, 2023
1 parent 2cbd89f commit 801358f
Showing 1 changed file with 9 additions and 1 deletion.
@@ -1,6 +1,7 @@
package org.dcache.chimera.nfsv41.mover;

import com.google.common.collect.Sets;
import com.google.common.net.InetAddresses;
import com.google.common.util.concurrent.ThreadFactoryBuilder;
import diskCacheV111.util.CacheException;
import diskCacheV111.util.DiskErrorCacheException;
Expand All @@ -17,6 +18,7 @@
import java.io.File;
import java.io.IOException;
import java.io.InterruptedIOException;
import java.io.PrintWriter;
import java.net.BindException;
import java.net.InetAddress;
import java.net.InetSocketAddress;
Expand Down Expand Up @@ -46,7 +48,6 @@
import org.dcache.commons.stats.RequestExecutionTimeGauges;
import org.dcache.nfs.ChimeraNFSException;
import org.dcache.nfs.status.BadHandleException;
import org.dcache.nfs.status.BadStateidException;
import org.dcache.nfs.v4.AbstractNFSv4Operation;
import org.dcache.nfs.v4.AbstractOperationExecutor;
import org.dcache.nfs.v4.CompoundContext;
Expand Down Expand Up @@ -555,4 +556,11 @@ public void run() {
});
}
}

@Override
public void getInfo(PrintWriter pw) {
CellInfoProvider.super.getInfo(pw);
var endpoint = _rpcService.getInetSocketAddress(IpProtocolType.TCP);
pw.printf(" Listening on: %s:%d\n", InetAddresses.toUriString(endpoint.getAddress()), endpoint.getPort());
}
}

0 comments on commit 801358f

Please sign in to comment.