Skip to content

Commit

Permalink
nfsv4: initialise CDC for better logging
Browse files Browse the repository at this point in the history
Acked-by: Paul Millar
Target: trunk, 2.6
Require-book: no
Require-notes: no
Signed-off-by: Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>
  • Loading branch information
kofemann committed May 10, 2013
1 parent c334510 commit b1e8efc
Showing 1 changed file with 10 additions and 2 deletions.
Expand Up @@ -35,6 +35,7 @@
import diskCacheV111.vehicles.PoolMoverKillMessage;
import diskCacheV111.vehicles.PoolPassiveIoFileMessage;

import dmg.cells.nucleus.CDC;
import dmg.cells.nucleus.CellMessage;
import dmg.cells.nucleus.CellPath;
import dmg.cells.services.login.LoginManagerChildrenInfo;
Expand Down Expand Up @@ -81,6 +82,7 @@
import org.dcache.chimera.nfs.vfs.Inode;
import org.dcache.chimera.nfs.vfs.VirtualFileSystem;
import org.dcache.chimera.nfsv41.mover.NFS4ProtocolInfo;
import org.dcache.commons.util.NDC;
import org.dcache.util.RedirectedTransfer;
import org.dcache.util.Transfer;
import org.dcache.util.TransferRetryPolicy;
Expand Down Expand Up @@ -130,7 +132,8 @@ public class NFSv41Door extends AbstractCellComponent implements
*/
private CellStub _poolManagerStub;
private CellStub _billingStub;

private String _cellName;
private String _domainName;
private PnfsHandler _pnfsHandler;

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

public void init() throws Exception {

_cellName = getCellName();
_domainName = getCellDomainName();
final NFSv41DeviceManager _dm = this;

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

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

Expand Down

0 comments on commit b1e8efc

Please sign in to comment.