Bug 56698 - Sessions will be backed up too often by PersistentManager
Summary: Sessions will be backed up too often by PersistentManager
Status: RESOLVED FIXED
Alias: None
Product: Tomcat 8
Classification: Unclassified
Component: Catalina (show other bugs)
Version: 8.0.x-trunk
Hardware: All All
: P2 normal (vote)
Target Milestone: ----
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-07-05 15:16 UTC by Felix Schumacher
Modified: 2014-07-07 13:07 UTC (History)
0 users



Attachments
Add a flag to PersistentManager whether it will save idle sessions once or always (12.29 KB, patch)
2014-07-05 15:16 UTC, Felix Schumacher
Details | Diff
Persist sessions only once while lastAccessedTime is not changed (7.94 KB, patch)
2014-07-07 05:07 UTC, Felix Schumacher
Details | Diff
Simple version of the patch for tomcat 7 (8.01 KB, patch)
2014-07-07 05:12 UTC, Felix Schumacher
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Felix Schumacher 2014-07-05 15:16:58 UTC
Created attachment 31793 [details]
Add a flag to PersistentManager whether it will save idle sessions once or always

The PersistentManager will save every Session which has not been accessed since maxIdleBackup time on every round.

The attached patch will introduce a flag, so that the admin can decide whether he wants to have the old behaviour, or the more efficient one of only saving sessions once, when they were accessed and idle for maxIdleBackup.

The patch gets a lot simpler, if we just change the behaviour and declare the old one as a bug :)

Tomcat 7 has the same problem and I could provide a patch for it, too.
Comment 1 Mark Thomas 2014-07-06 21:47:42 UTC
Lets go with the more efficient behaviour. I see no good reason to introduce yet another configuration option just to enable inefficient behaviour to continue. Can you provide the simpler patch?
Comment 2 Felix Schumacher 2014-07-07 05:07:19 UTC
Created attachment 31798 [details]
Persist sessions only once while lastAccessedTime is not changed

Simpler version of the previous patch. TestCase is included still.
Comment 3 Felix Schumacher 2014-07-07 05:12:33 UTC
Created attachment 31799 [details]
Simple version of the patch for tomcat 7

Same functionality of the simpler patch for tomcat 7.
Comment 4 Mark Thomas 2014-07-07 13:07:18 UTC
Thanks for the report and for the patches.

This has been fixed in 8.0.x for 8.0.10 onwards and in 7.0.x for 7.0.55 onwards.