Commit Graph

7 Commits

Author SHA1 Message Date
Michael Xavier
6edd459223 Wall-werror all the things 2017-02-01 18:20:55 -08:00
Michael Xavier
d135958be5 Update comments, exercise expiration codepath
I wanted to at least ensure my change's code was excerised, even though
it makes no material difference to the allStorageTests suite.
2016-03-12 13:11:43 -08:00
Michael Xavier
7d922d1de4 Add first stab at backend auto expiry
This is for issue #7

So it would be nice if we had access to `State` because it would provide
us with `cookieExpires`, but nothing in the machinery of serversession
makes it available to backends for some reason. Also the tests seem to
indicate that the State may not be available at the time of setting up
storange engines (or may be a chicken-and-egg situation). The best
solution seemed to be to take the settings for absolute and idle timeout
that you're going to give to the state and share them.

Just as a reminder for the motivation on this: currently in
serversession's redis backend, you accumulate sessions
indefinitely. Even after they expire, they will stay in redis. The other
backends seem vulnerable to this too but its probably not nearly a big
deal in something like persistent because:

1. Storage is not as much of a premium in peristent's supported backend
compared to redis. They are primarily storing to disk.
2. Persistent's backends have good querying primitives so it is simple
to write jobs to delete old sessions.

Redis must fit all data in memory, so storage is at a premium and in
order to find old keys you'd have to issue the frowned-upon KEYS
command (or SCAN which isn't even suppored by hedis yet) and parse every
session.

This change uses redis' built in expiry mechanism and sets the
expiration every time a write operation is made to a session. Sessions
as they would naturally expire on the client side will now automatically
expire and free memory on the backend.
2016-03-11 16:54:14 -08:00
Felipe Lessa
ec4623da34 Do not run large data tests in parallel.
Brings peak memory usage of the persistent test suite from 6 GiB to
4 GiB.  Still very bad, though.
2015-05-28 13:02:54 -03:00
Felipe Lessa
ff6c0efaab Redis backend is all green. 2015-05-28 02:42:22 -03:00
Felipe Lessa
92fbee20da Fix copy-paste. 2015-05-28 02:23:00 -03:00
Felipe Lessa
7fdfd16216 Add test suite for redis backend.
Currently failing pretty badly. :(
2015-05-28 02:17:36 -03:00