He-Pin opened a new pull request, #3669: URL: https://github.com/apache/pekko/pull/3669
### Motivation Complete the Runnable-based equality semantics requested after #3668 added delegated hash codes. Two wrappers of the same or equal Runnables should compare equal. The previous identity-based equality was legal; this follow-up deliberately changes that behavior. ### Modification - Override `equals` for comparisons between `PekkoForkJoinTask` instances, delegating to the wrapped Runnable alongside the existing `hashCode` override. - Document that equal wrappers share a hash-collection key while retaining independent completion and cancellation state. - Add regression coverage for equality, hash collisions in a real `HashSet`, reference-based tracking, and independent execution and cancellation in the pool. ### Result Fresh wrappers preserve the Runnable's equality and hash code without sharing task lifecycle state. Callers tracking individual submissions can still distinguish them by reference identity. ### Tests - Before the fix: 3 equality regressions failed and 4 existing execution tests passed. - `sbt "+actor-tests / Test / testOnly org.apache.pekko.dispatch.MailboxTaskSubmissionSpec"`: all 8 final tests passed on Scala 2.13.18 and 3.3.8 with JDK 17. - The same 8 tests passed on Scala 2.13.18 with JDK 25.0.2. - Related mailbox and dispatcher suites: 74 tests passed, 2 existing JDK-dependent tests pending. - `scalafmt --mode diff-ref=origin/main`, `headerCreateAll`, `checkCodeStyle` (including `+headerCheckAll`), `+mimaReportBinaryIssues`, and `git diff --check`: passed. - Auditable Qoder stdout review and follow-up: No must-fix findings. - `validatePullRequest`: not run locally; further validation is delegated to remote CI at the user's request. ### References Refs #3668, including the [follow-up request for equals](https://github.com/apache/pekko/pull/3668#issuecomment-6360732623) and the [HashSet coverage comment](https://github.com/apache/pekko/pull/3668#discussion_r4357192242). -- 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]
