Skip to content

Commit 97c4bec

Browse files
committed
core: Force bad-session error upon seqid=-1
Under some rare circumstances, especially when under I/O pressure, NFS clients such as those on macOS may try to send NFS requests with an invalid state id (seq=-1, other:ffffffffffffffffffffffff). This usually happens after the NFS server has been restarted and lost information about the previous client state. Unfortunately, the macOS client does not recover from this situation and keeps making requests to the server. This slows down both server and client to a halt. Send a "bad session" error upon occurring a seqid of -1. This lets the NFS client reconnect and the server establish the correct state. Fixes: #160 Signed-off-by: Christian Kohlschütter <[email protected]>
1 parent d72a1ae commit 97c4bec

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

core/src/main/java/org/dcache/nfs/v4/NFSv4StateHandler.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,10 @@ public NFS4Client getClient(clientid4 clientid) throws StaleClientidException {
238238
}
239239

240240
public NFS4Client getClientIdByStateId(stateid4 stateId) throws ChimeraNFSException {
241+
if (stateId.seqid == -1) {
242+
// invalid; force reconnect
243+
throw new BadSessionException();
244+
}
241245

242246
_readLock.lock();
243247
try {

0 commit comments

Comments
 (0)