Use LRU order for persistent session swaps - #1045
Merged
markt-asf merged 1 commit intoAug 17, 2026
Merged
Conversation
Contributor
Author
|
@remm, would you be willing to review this? You have the most recent changes in these session-manager paths. This completes the checked-in TODO 5.1 item with focused regression coverage. |
markt-asf
marked this pull request as ready for review
August 17, 2026 10:52
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
maxActiveSessionsRationale
PersistentManagerBase.processMaxActiveSwaps()previously consumed the manager's unordered session array, so the sessions selected for persistence were arbitrary. This completes the maintained TODO 5.1 item inTODO.mdwhile preserving the existing threshold and eligibility checks.Impact
Only the victim selection order changes: when the active-session limit is exceeded, older eligible sessions are swapped before newer ones.
Validation
All final gates passed against commit
d475a6bf38227a1b3f66a37c3591e79468627c7c.JAVA_HOME=/opt/homebrew/opt/openjdk/libexec/openjdk.jdk/Contents/Home ant test -Dtest.entry=org.apache.catalina.session.TestPersistentManager -Dtest.silent=true— passedJAVA_HOME=/opt/homebrew/opt/openjdk/libexec/openjdk.jdk/Contents/Home ant -Dexecute.validate=true validate— passed (Checkstyle 13.9.0)JAVA_HOME=/opt/homebrew/opt/openjdk/libexec/openjdk.jdk/Contents/Home ant clean— passedJAVA_HOME=/opt/homebrew/opt/openjdk/libexec/openjdk.jdk/Contents/Home ant— passedJAVA_HOME=/opt/java/openjdk ant test -Dtest.silent=true -Dtest.threads=1 -Dtest.openssl.path=/usr/bin/opensslin an isolated Ubuntu/Temurin 21 container — passed in 27m07s: 649 suites, 41,258 tests, 0 failures, 0 errors, 314 skipped/, and stopped cleanly with the server PID exitingThe initial macOS four-thread full-suite attempt hit five multicast tests with
NoRouteToHostException, so the complete suite was moved to Linux. Two preliminary four-thread Linux runs each exposed an unrelated timing/parallelism failure (TestTimeBucketCounter; thenTestRateLimitFilterWithExactRateLimiterplus a fixed-port standalone fork conflict); every affected test passed alone. The final unfiltered Linux run above used one test thread and passed completely.