[PATCH] Speed up user requests while offline
This adds a new boolean option to sss_dp_send_acct_req() called
fast_reply. If we make a request to the backends and we are
currently offline, this option will determine whether we should
immediately return from the cache (acceptable for NSS requests) or
potentially wait for an online check to complete (required for PAM
requests).
If we immediately return from cache, we will still continue processing
in the backend. If it is time to do an online check, it will happen out
of band.
On 11/16/2009 05:44 PM, Simo Sorce wrote:
On Mon, 2009-11-16 at 16:01 -0500, Stephen Gallagher wrote:
>
>
> When offline, we check at regular intervals to see if the backend
> has come back online. This means that every n seconds (the online
> check interval), NSS requests may lag as we attempt to go out to
> the remote server and update the cache.
>
> With this patch, we will now always return the cached data while
> we are offline and queue up an out-of-band cache refresh to
> determine whether the data provider is back online.
Uhmm, unfortunately I have to nack this one.
The problem is that you can't trust what you receive to be authoritative
for the future.
For example, between the last call from the nss frontend and the new one
the backend can have run an enumeration task that have discovered we are
back online.
In that case it would probably be advisable to do an online refresh,
except that you don't know that the backend is actually online because
last time you got an answer it was offline.
We should probably always contact the backend and let the backend know
we want a "quick" answer by adding a parameter in the sbus call.
If we require a "quick" call and the backend is offline it will
immediately return back an offline error and then schedule an out of
band request to try to go online.
Simo.
--
Stephen Gallagher
RHCE 804006346421761
Delivering value year after year.
Red Hat ranks #1 in value among software vendors.
http://www.redhat.com/promo/vendor/