Skip to content

Commit b1e8efc

Browse files
committed
nfsv4: initialise CDC for better logging
Acked-by: Paul Millar Target: trunk, 2.6 Require-book: no Require-notes: no Signed-off-by: Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>
1 parent c334510 commit b1e8efc

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

modules/dcache/src/main/java/org/dcache/chimera/nfsv41/door/NFSv41Door.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
import diskCacheV111.vehicles.PoolMoverKillMessage;
3636
import diskCacheV111.vehicles.PoolPassiveIoFileMessage;
3737

38+
import dmg.cells.nucleus.CDC;
3839
import dmg.cells.nucleus.CellMessage;
3940
import dmg.cells.nucleus.CellPath;
4041
import dmg.cells.services.login.LoginManagerChildrenInfo;
@@ -81,6 +82,7 @@
8182
import org.dcache.chimera.nfs.vfs.Inode;
8283
import org.dcache.chimera.nfs.vfs.VirtualFileSystem;
8384
import org.dcache.chimera.nfsv41.mover.NFS4ProtocolInfo;
85+
import org.dcache.commons.util.NDC;
8486
import org.dcache.util.RedirectedTransfer;
8587
import org.dcache.util.Transfer;
8688
import org.dcache.util.TransferRetryPolicy;
@@ -130,7 +132,8 @@ public class NFSv41Door extends AbstractCellComponent implements
130132
*/
131133
private CellStub _poolManagerStub;
132134
private CellStub _billingStub;
133-
135+
private String _cellName;
136+
private String _domainName;
134137
private PnfsHandler _pnfsHandler;
135138

136139
private String _ioQueue;
@@ -206,6 +209,8 @@ public void setEnableV3(boolean enable) {
206209

207210
public void init() throws Exception {
208211

212+
_cellName = getCellName();
213+
_domainName = getCellDomainName();
209214
final NFSv41DeviceManager _dm = this;
210215

211216
_rpcService = new OncRpcSvc(_port, IpProtocolType.TCP, true);
@@ -339,7 +344,9 @@ public Layout layoutGet(CompoundContext context, Inode nfsInode, int ioMode, sta
339344
throws IOException {
340345

341346
FsInode inode = _fileFileSystemProvider.inodeFromBytes(nfsInode.getFileId());
342-
try {
347+
try(CDC cdc = CDC.reset(_cellName, _domainName)) {
348+
NDC.push("pnfsid=" + inode);
349+
NDC.push("client=" + context.getRpcCall().getTransport().getRemoteSocketAddress());
343350
deviceid4 deviceid;
344351
if (inode.type() != FsInodeType.INODE || inode.getLevel() != 0) {
345352
/*
@@ -349,6 +356,7 @@ public Layout layoutGet(CompoundContext context, Inode nfsInode, int ioMode, sta
349356
} else {
350357
InetSocketAddress remote = context.getRpcCall().getTransport().getRemoteSocketAddress();
351358
PnfsId pnfsId = new PnfsId(inode.toString());
359+
Transfer.initSession();
352360
NfsTransfer transfer = new NfsTransfer(_pnfsHandler, Subjects.ROOT, new FsPath("/"),
353361
remote, stateid);
354362

0 commit comments

Comments
 (0)