Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing callback for OP_CLOSE in VirtualFileSystem #38

Open
dkocher opened this issue Jul 18, 2016 · 2 comments
Open

Missing callback for OP_CLOSE in VirtualFileSystem #38

dkocher opened this issue Jul 18, 2016 · 2 comments

Comments

@dkocher
Copy link
Contributor

dkocher commented Jul 18, 2016

I am missing a notification in the virtual filesystem for CLOSE operations. Would be nice if the VirtualFileSystem can be extended with a close operation that is called from org.dcache.nfs.v4.OperationCLOSE.

@kofemann
Copy link
Member

As client can merge multiple opens into a single one you must bind your close action to open-state-id, which on dispose will call-back your onClose action.. By saying that I am pretty sure nfs4j does not provides a way to create such a binding. One possibility will be to extend CLOSE and OPEN operations and add required functionality. For example:

https://github.com/dCache/dcache/blob/master/modules/dcache-nfs/src/main/java/org/dcache/chimera/nfsv41/door/proxy/ProxyIoClose.java

https://github.com/dCache/dcache/blob/master/modules/dcache-nfs/src/main/java/org/dcache/chimera/nfsv41/door/proxy/ProxyIoMdsOpFactory.java

As you have a valid use-case, I am fine to add a functionality which will make tracking of open+close operation simple. Can you provide a little bit more context?

@dkocher
Copy link
Contributor Author

dkocher commented Jul 19, 2016

The context is as follows (sorry for asking for a solution instead of describing the problem): The implementation of the virtual filesystem handles a persistent connection for open files with java.io.* with an open output or input stream while a write or read operation is in progress. Therefore it is crucial to close the underlying stream once a CLOSE operation is received to flush the changes. We are looking to replace our current NFSv3 implementation in Mountain Duck with nfs4j.

dkocher added a commit to iterate-ch/nfs4j that referenced this issue May 25, 2020
dkocher added a commit to iterate-ch/nfs4j that referenced this issue May 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants