Skip to content

Conversation

@kohlschuetter
Copy link
Contributor

Currently, we are calling Files.getFileStore for every request to VirtualFileSystem.getFileStat.

On some systems, such as macOS, this may introduce extremely long wait times for NFS operations, effectively hanging the entire NFS client. Delays as high as 14 seconds (!) have been observed.

Move the FileStore access to LocalFileSystem's constructor, such that it can be reused.

Stack trace for observed hang:

	at [email protected]/sun.nio.fs.BsdNativeDispatcher.getfsstat(Native Method)
	at [email protected]/sun.nio.fs.BsdFileSystem.getMountEntries(BsdFileSystem.java:169)
	at [email protected]/sun.nio.fs.BsdFileStore.findMountEntry(BsdFileStore.java:75)
	at [email protected]/sun.nio.fs.UnixFileStore.<init>(UnixFileStore.java:69)
	at [email protected]/sun.nio.fs.BsdFileStore.<init>(BsdFileStore.java:42)
	at [email protected]/sun.nio.fs.BsdFileSystemProvider.getFileStore(BsdFileSystemProvider.java:48)
	at [email protected]/sun.nio.fs.BsdFileSystemProvider.getFileStore(BsdFileSystemProvider.java:36)
	at [email protected]/sun.nio.fs.UnixFileSystemProvider.getFileStore(UnixFileSystemProvider.java:422)
	at [email protected]/java.nio.file.Files.getFileStore(Files.java:1496)
	at app//org.dcache.nfs4j.server.LocalFileSystem.getFsStat(LocalFileSystem.java:209)
	at app//org.dcache.nfs.vfs.ForwardingFileSystem.getFsStat(ForwardingFileSystem.java:57)
	at app//org.dcache.nfs.v4.OperationGETATTR.getFsStat(OperationGETATTR.java:176)
	at app//org.dcache.nfs.v4.OperationGETATTR.fattr2xdr(OperationGETATTR.java:262)
	at app//org.dcache.nfs.v4.OperationGETATTR.getAttributes(OperationGETATTR.java:145)
	at app//org.dcache.nfs.v4.OperationGETATTR.getAttributes(OperationGETATTR.java:169)
	at app//org.dcache.nfs.v4.OperationGETATTR.process(OperationGETATTR.java:124)
	at app//org.dcache.nfs.v4.AbstractOperationExecutor.execute(AbstractOperationExecutor.java:85)
	at app//org.dcache.nfs.v4.NFSServerV41.NFSPROC4_COMPOUND_4(NFSServerV41.java:201)
	at app//org.dcache.nfs.v4.xdr.nfs4_prot_NFS4_PROGRAM_ServerStub.dispatchOncRpcCall(nfs4_prot_NFS4_PROGRAM_ServerStub.java:48)
	at app//org.dcache.oncrpc4j.rpc.RpcDispatcher$1.run(RpcDispatcher.java:122)
	at [email protected]/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
	at [email protected]/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
	at [email protected]/java.lang.Thread.runWith(Thread.java:1583)
	at [email protected]/java.lang.Thread.run(Thread.java:1570)

Currently, we are calling Files.getFileStore for every request to
VirtualFileSystem.getFileStat.

On some systems, such as macOS, this may introduce extremely long wait
times for NFS operations, effectively hanging the entire NFS client.
Delays as high as 14 seconds (!) have been observed.

Move the FileStore access to LocalFileSystem's constructor, such that it
can be reused.

Signed-off-by: Christian Kohlschütter <[email protected]>
@kohlschuetter kohlschuetter force-pushed the ck/LocalFileSystem-FileStore branch from 1046840 to 9829fe8 Compare June 11, 2025 15:45
@kofemann
Copy link
Member

@kohlschuetter Thanks for your contribution.

@kofemann kofemann merged commit 43b7ded into dCache:master Jun 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants