[PR] Reset noContextManagerReceived when requesting session st ate [tomcat]

lihongyi87 (via GitHub) <[email protected]>
Newsgroups gmane.comp.jakarta.tomcat.devel
Message-ID <[email protected]>
lihongyi87 opened a new pull request, #1047:
URL: https://github.com/apache/tomcat/pull/1047

   ## Problem
   
   `noContextManagerReceived` is set to `true` when `EVT_ALL_SESSION_NOCONTEXTMANAGER` is received and is never reset. `getAllClusterSessions()` resets `stateTransferred` before requesting session state but leaves `noContextManagerReceived` set.
   
   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 `stateTransferred` when requesting session state, so the wait is governed only by the response to the current request.
   
   ## Testing
   
   Two tests in `TestDeltaManagerStateTransfer` verify both flags are reset when `getAllClusterSessions()` is called with a mocked cluster member. On unpatched code the noContextManagerReceived test fails; with the fix both pass.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.