| Project: | iMo-2011B |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Jurjen |
| Status: | closed |
Sessions should expire when the time between session:DeactivateSession and session:ActivateSession is more than X minutes.
Not when the time between ActivateSession and DeactivateSession is too much, that would be just bad performance. It turns out that imo is checking that too, currently.
So the only time you need to look at expirationtime is during ActivateSession, and the only time you need to reset it is during DeactivateSession.
Instead, the expiration is now checked and reset during every locateContextValue() in ContextDatabase.cls. That's a lot of times in an active session, while only the first check and the last reset are relevant. That causes several problems:
- waste of time
- lock on ContextSet record (for add-interval) has bugged us once or twice
and the most important one: not every context is a sessioncontext.
You can have context for ever kind of process, session is just one example. A statefree server cannot control if clients have abandoned the system without saying goodbye, so a timeout is a valid guard. But for other contexts it is not. So the expiration should be checked and reset by the Session class, which can still use the Context class to store and fetch that.
Comments
#1
About those locks:
We are using a semi-asynchronous client (Adobe Flex) and a statefree appserver. It happens that the client does an appserver request before the previous request has ended. So there are 2 (or more) appserver agents running for the same session at the same time. Each time when a context value is searched, teh ContextSet record is locked. Soon both agents are in a deadlock.
#2
Duplicate of issue #578
#3
#4
No I don't think its a duplicate of 578.
578 proposes a work-around for the lock. It helps, yes.
But it does not consider that timeout should only be checked at session:activate (and reset only at session:deactivate)
#5
#6
why did you set the status to "to test", it was not fixed at all!
Session:ActivateSession still does not check if the session is valid or expired, the expiration is still checked during context:getvalue which gets in the way when contextmanager is used for contexts that are not sessioncontext.
#7
back from "to test" to "active"
#8
#9
Virgil could not reproduce this issue and reassigned it back to Zoltan to have it tested by somebody else from the team. That was Virgil's intention and I agree one could have understood differently :-).
This is put back to active and we will investigate more.
#10
Reset and check context is moved to SessionManager. This way, only once is checked/appserver call.
#11
#12
Automatically closed -- issue fixed for two weeks with no activity.