Reset noContextManagerReceived when requesting session state - #1047
Open
lihongyi87 wants to merge 1 commit into
Open
Reset noContextManagerReceived when requesting session state#1047lihongyi87 wants to merge 1 commit into
lihongyi87 wants to merge 1 commit into
Conversation
The flag is set when EVT_ALL_SESSION_NOCONTEXTMANAGER is received and is never reset. getAllClusterSessions() resets stateTransferred before requesting session state but leaves noContextManagerReceived set, so waitForSendAllSessions() returns immediately for every subsequent state transfer on the same manager instance, skipping sessions the cluster does send. Reset the flag alongside stateTransferred.
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.
Problem
noContextManagerReceivedis set totruewhenEVT_ALL_SESSION_NOCONTEXTMANAGERis received and is never reset.getAllClusterSessions()resetsstateTransferredbefore requesting session state but leavesnoContextManagerReceivedset.Because
waitForSendAllSessions()includes!isNoContextManagerReceived()in its loop condition, every subsequent state transfer on the same manager instance returns immediately — even when the cluster node now has a context manager and sends session state. The sessions are skipped.The flag has existed since it was introduced in 2011 (r1195384) without a reset.
Trigger
A manager instance receives
ALL_SESSION_NOCONTEXTMANAGER(peer not yet deployed), then the same instance requests session state again — for example after a web application reload (reloadable=true) reuses the manager.Fix
Reset the flag alongside
stateTransferredwhen requesting session state, so the wait is governed only by the response to the current request.Testing
Two tests in
TestDeltaManagerStateTransferverify both flags are reset whengetAllClusterSessions()is called with a mocked cluster member. On unpatched code the noContextManagerReceived test fails; with the fix both pass.