Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 337746

Summary: infinite loop in HashedSession.deIdle()
Product: [RT] Jetty Reporter: Roger Armstrong <roger>
Component: serverAssignee: Greg Wilkins <gregw>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: jetty-inbox
Version: unspecified   
Target Milestone: 7.2.x   
Hardware: Macintosh   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:

Description Roger Armstrong CLA 2011-02-21 13:01:15 EST
Build Identifier: jetty-7.3.0.v20110203

I'm using the HashSessionManager setIdleSavePeriod(900) to evict idle sessions to disk. This works fine, but when a request comes in for the idled session, the HashSessionManager tries to deIdle() the session, which in turn calls restoreSession() which calls session.setAttribute() which calls session.isNotAvailable() which calls deIdle() and so on ad infinitum.

Should the _idled flag perhaps be set to false before calling restoreSession instead of after? This would prevent the recursion...

Here's part of the stack showing the recursion:

HashSessionManager$HashedSession.deIdle() line: 717	
HashSessionManager$HashedSession.isNotAvailable() line: 610	
HashSessionManager$HashedSession(AbstractSessionManager$Session).setAttribute(String, Object) line: 1175	
HashSessionManager.restoreSession(InputStream, HashSessionManager$HashedSession) line: 565	
HashSessionManager$HashedSession.deIdle() line: 717	
HashSessionManager$HashedSession.isNotAvailable() line: 610	
HashSessionManager$HashedSession(AbstractSessionManager$Session).setAttribute(String, Object) line: 1175	
HashSessionManager.restoreSession(InputStream, HashSessionManager$HashedSession) line: 565	
HashSessionManager$HashedSession.deIdle() line: 717	
HashSessionManager$HashedSession.isNotAvailable() line: 610	
HashSessionManager$HashedSession(AbstractSessionManager$Session).setAttribute(String, Object) line: 1175	
HashSessionManager.restoreSession(InputStream, HashSessionManager$HashedSession) line: 565	
HashSessionManager$HashedSession.deIdle() line: 717	
HashSessionManager.getSession(String) line: 373	



Reproducible: Always

Steps to Reproduce:
1. setIdleSavePeriod(60) - 60 seconds for testing
2. let the session go idle
3. deIdle the session by sending a request for the session
Comment 1 Greg Wilkins CLA 2011-02-21 22:57:47 EST
r2814