You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by "lihongyi87 (via GitHub)" <gi...@apache.org> on 2026/08/18 15:25:39 UTC

[PR] Reset noContextManagerReceived when requesting session state [tomcat]

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: dev-unsubscribe@tomcat.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: [PR] Reset noContextManagerReceived when requesting session state [tomcat]

Posted by "markt-asf (via GitHub)" <gi...@apache.org>.
markt-asf commented on PR #1047:
URL: https://github.com/apache/tomcat/pull/1047#issuecomment-5958318449

   Fixed in one of @rmaucher's code reviews


-- 
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: dev-unsubscribe@tomcat.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: [PR] Reset noContextManagerReceived when requesting session state [tomcat]

Posted by "markt-asf (via GitHub)" <gi...@apache.org>.
markt-asf closed pull request #1047: Reset noContextManagerReceived when requesting session state
URL: https://github.com/apache/tomcat/pull/1047


-- 
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: dev-unsubscribe@tomcat.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org