The GitHub Actions job "Link Validator" on pekko.git/main has failed. Run started by GitHub user raboof (triggered by raboof).
Head commit for run: cf6784b95253f2963750dbfd446970a295b424d8 / He-Pin(kerr) <[email protected]> fix: return proper thread-safe Cancellable from StubbedActorContext.scheduleOnce (#3268) Motivation: StubbedActorContext.scheduleOnce returned a Cancellable with isCancelled=true and cancel()=false, violating the Cancellable contract which states isCancelled should be true "if and only if" the Cancellable has been successfully cancelled. A freshly scheduled task has not been cancelled, so isCancelled must start false. This caused test/production divergence: actors checking cancellable.isCancelled would take different code paths in tests vs production. Modification: Replace the pre-cancelled Cancellable stub with a thread-safe implementation that mixes AtomicBoolean directly into the Cancellable: new AtomicBoolean(false) with classic.Cancellable { override def cancel(): Boolean = compareAndSet(false, true) override def isCancelled: Boolean = get() } - compareAndSet(false, true) ensures at most one successful cancellation even under concurrent access, matching the thread-safety best practice noted in the Cancellable trait Scaladoc - Mixing AtomicBoolean directly avoids an extra field allocation Result: StubbedActorContext.scheduleOnce now returns a Cancellable that matches the Cancellable contract and the real production implementation behavior. Actors that check cancellable.isCancelled will behave consistently in tests and production. Tests: - sbt "actor-testkit-typed / Test / testOnly *BehaviorTestKitSpec *BehaviorTestKitTest" - 52 passed, 1 ignored References: Fixes #3251 Report URL: https://github.com/apache/pekko/actions/runs/28357363158 With regards, GitHub Actions via GitBox --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
