[EMAIL PROTECTED] wrote:
luehe 2003/08/18 17:49:58

Modified: catalina/src/share/org/apache/catalina/session
PersistentManagerBase.java StandardManager.java
StandardSession.java StoreBase.java
Log:
Fixed Bugtraq 4839736 ("HttpSession.setMaxInactiveInterval() doesn't
behave as expected")
Patch provided by [EMAIL PROTECTED]
The following test case used to fail intermittently, due to a race
condition between the 2nd session access and the background thread
that invalidates expired sessions:
HttpSession session1 = req.getSession();
session1.setMaxInactiveInterval(5);
try {
Thread.sleep(10 * 1000);
} catch (InterruptedException e) { e.printStackTrace(); }
HttpSession session2 = req.getSession(false);
if (session2 == null) {
// SUCCESS
} else {
// FAIL!!
}

This is a possibly risky patch. If you could have waited after 5.0.8, I would have been happier :)


Anyway, the comment made me realize that the store was the only component left using the one thread per manager (= per webapp) model. Obviously, this is going to need fixing.
I'm going to commit something. To make it cleaner and reduce inter package dependencies, I think a processExpires method should be added to both the Manager and Store interfaces (and implemented in ManagerBase and StoreBase, so existing 3rd party impls shouldn't be affected as long as they extended the base classes - otherwise, making them compatible should be trivial enough anyway).


Remy



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to