Subject: [nfsv4] Sleepy clients

From: Brent Callaghan <[email-masked]>
Date: Thu, 25 Aug 2005 14:16:56 -0700

My workstation goes to sleep if I leave it idle for more than 15  
minutes.

It turns the display, fans and disk off and the rest of it goes into
snooze mode.  It transmits and receives nothing on the network while
it's asleep.  My laptop does the same thing - it also goes to sleep  
almost
instantly if I close it.

As an NFSv4 client, I presume the server would deal with this behavior
rather harshly.  The server would assume that a "network partition" had
occurred and at lease expiration it would take action to revoke the
sleeping client's open files, delegations, locks etc.

RFC3530 makes no mention of sleepy clients, though it does
describe what should happen if a network partition should occur.
Section 8.6.3 says that the client is responsible for re-establishing
any state lost after a network partition that causes a lease to expire -
and mentions that "network partitions are relatively rare."
However, client sleeps can be *very* frequent.  My workstation sleeps
about half a dozen times a day and some laptop users go through the
sleep/wakeup cycle dozens of times a day. That's a lot of state  
recovery,
lost locks, and potential for app breakage.

If the client could tell the server that it's going to sleep, then  
the server
could use that as a hint that it should hold off destroying the client's
state when its lease expires, e.g.

	OP_ZZZZ  <clientid>

	The client is going to sleep for an indeterminate time and will
	be unable to RENEW its lease. The server SHOULD automatically
	extend the client's lease for as long as possible, or until the  
client resumes
	activity.

This would be simple to implement - and provide a more stable service
for sleepy clients.  The server could establish a configurable upper  
limit
on how long it's going to wait for the client to wake up (perhaps one or
two days).

Opinions ?

	Thanks
		Brent

_______________________________________________
nfsv4 mailing list
[email-masked]
https://www1.ietf.org/mailman/listinfo/nfsv4

---

From: "J. Bruce Fields" <[email-masked]>
Date: Thu, 25 Aug 2005 17:32:08 -0400

On Thu, Aug 25, 2005 at 02:16:56PM -0700, Brent Callaghan wrote:
> limit on how long it's going to wait for the client to wake up
> (perhaps one or two days).
> 
> Opinions ?

Only the obvious--I've also seen laptops that wake up unreliably.  I
also usually forget to unmount before taking my laptop home with me.
Can the server really be expected to hold locks for a client for hours
or days?

It sounds like an unsolveable problem.  Maybe the OS can just refuse to
sleep while it's holding locks on a network filesystem?

--b.