> The problem isn't the lazy programmers, it's the not lazy
> programmers who can't do anything about the fact that they're
> creating a lot of result sets, needlessly. Or that they're
> creating sets that they need for 30 seconds that are lasting
> for 10 minutes. Or that they're having to poke the sets to
> update their idle time out because they need them for 24 hours.
Poking the sets to update idle time sounds like an excellent idea to me!
I disagree with Mikes premise that clients (in the general case) will
actually know the purpose of the result set any more than the server.
Ignoring for the moment some of Rob's more specialised applications
(which I think could be handled using new operations rather than
overloading searchRetrieve), a generic client is not going to know
whether the user is going to reused a result set there and then, or go
and make a cup of tea/have lunch/climb a mountain before coming back to
the computer. Either the client can poke sets periodically based on
whether they've detected user activity (or prompt the user that a result
set is nearing expiry and should it request an extension) or if we have
a requestedTTL the lazier client could just request a large TTL by
default and (as Ralph has argued) we're back to not knowing whether we
are getting large TTL requests because the client really needs it or
because the client is lazy (or because we're being attacked by a DoS
attack, which is somewhat unavoidable whatever mechanisms we adopt!).
> I could also randomly delete result sets, but the chances of keeping
ones that are actually wanted over ones that aren't is pretty minimal.
I think a robust SRW implementation would probably have some maximum
setting for number of result sets it would allow at any one time (with
tricks as suggested by Adam and Ralph for reused of result sets) - if
only to survive DoS attacks which I can see a solution for (regardless
of client side TTL negotiation). TTL's would probably get shorter as
this maximum is increased. If this maximum is exceeded it would need to
delete result sets but I think we can do better than just at random. We
could delete the results set which is closest to its TTL for example.
Matthew
|