He-Pin opened a new pull request, #3699:
URL: https://github.com/apache/pekko/pull/3699

   ### Motivation
   `ClusterSingletonManager` releases its lease from two places. The 
`AcquiringLease -> _` transition converts a failed `Future` into 
`ReleaseLeaseFailure`, but the `Oldest -> _` transition does not, so a failure 
there arrives as a `Status.Failure` that the FSM does not handle. When the 
lease backend is unavailable during a hand-over, no "failed to release lease" 
error is logged — exactly the situation where the diagnostic matters, because a 
lease that was never released can delay the next singleton activation on 
another node.
   
   ### Modification
   - Mirror the `AcquiringLease` path in the `Oldest -> _` transition: 
`.recover { case t => ReleaseLeaseFailure(t) }`.
   - `TestLease`: add `setNextReleaseResult` (defaults to 
`Future.successful(true)`, so existing behavior is unchanged).
   - `ClusterSingletonLeaseSpec`: new case "log error when lease release fails 
leaving oldest" — triggers the transition via lease loss and asserts the 
`ReleaseLeaseFailure` handler logs the error.
   
   ### Result
   A failed lease release on the oldest transition is handled and logged 
instead of escaping as an unhandled message. Observability fix; no behavior 
change on the success path.
   
   ### Tests
   - `sbt "cluster-tools / Test / testOnly 
org.apache.pekko.cluster.singleton.ClusterSingletonLeaseSpec"`: 9/9 passed
   - Directional check: reverted the fix, re-ran the new test only — failed as 
expected
   - Full validation on CI
   
   ### References
   Fixes #3685


-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to