Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 337746 - infinite loop in HashedSession.deIdle()
Summary: infinite loop in HashedSession.deIdle()
Status: RESOLVED FIXED
Alias: None
Product: Jetty
Classification: RT
Component: server (show other bugs)
Version: unspecified   Edit
Hardware: Macintosh Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: 7.2.x   Edit
Assignee: Greg Wilkins CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-21 13:01 EST by Roger Armstrong CLA
Modified: 2011-02-21 22:57 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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