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

   ### Motivation
   
   `Identify` implements both `AutoReceivedMessage` and 
`NotInfluenceReceiveTimeout`. On JVMs affected by 
[JDK-8180450](https://bugs.openjdk.org/browse/JDK-8180450), alternating 
successful checks against those two secondary supertypes makes the same 
concrete `Klass` secondary-super cache ping-pong between marker types. The 
checks occur on the Actor receive-timeout path and can contend across 
actor-dispatcher threads.
   
   The receive path also classified the same message against 
`NotInfluenceReceiveTimeout` twice.
   
   ### Modification
   
   - Classify final `Identify` with a concrete-class guard before the 
`NotInfluenceReceiveTimeout` marker check.
   - Return the pre-cancellation timeout state and infer the post-receive 
reschedule decision from the state transition, removing the second marker check.
   - Add focused classification coverage.
   - Add a 12-thread JMH benchmark for the polluted, concrete-guarded, and 
final production-shaped paths.
   
   ### Result
   
   Receive-timeout behavior remains unchanged, while `Identify` no longer 
alternates the concrete class secondary-super cache between its two marker 
interfaces. The final path also performs one classification instead of two.
   
   JMH throughput (`ops/us`, 12 threads, 3 forks, 5 x 1 s warmup and 
measurement iterations):
   
   | Runtime | Polluted path | Concrete guard | Final path | Final / polluted |
   | --- | ---: | ---: | ---: | ---: |
   | JDK 17.0.17 | 824.700 +/- 10.066 | 1633.766 +/- 53.719 | 2205.529 +/- 
92.313 | 2.67x |
   | JDK 21.0.8 | 1125.827 +/- 16.496 | 1609.084 +/- 31.694 | 2158.924 +/- 
36.895 | 1.92x |
   | JDK 25.0.2 | 1717.703 +/- 77.349 | 1841.141 +/- 53.279 | 2467.700 +/- 
262.562 | 1.44x |
   
   JDK 21.0.8 and JDK 25 contain the JVM fix, so their remaining gain primarily 
measures the removed classification/call rather than secondary-super-cache 
contention. The JDK 25 result was noisier than the other runs.
   
   ### Tests
   
   - `sbt "actor-tests / Test / testOnly 
org.apache.pekko.actor.ReceiveTimeoutSpec"` - passed, 14 tests
   - `sbt "bench-jmh / Jmh / compile"` - passed
   - `scalafmt --list --mode diff-ref=origin/main` - passed
   - `sbt "+headerCheckAll" checkCodeStyle` - passed
   - `sbt +mimaReportBinaryIssues` - passed for Scala 2.13 and 3
   - `git diff --check` - passed
   - `sbt validatePullRequest` - ran for 26m49s; the changed Actor core 
expanded validation across dependent modules. It reported unrelated 
baseline/platform failures:
     - `TcpConnectionSpec` timed out under the full concurrent run; focused 
rerun passed all 35 executed tests.
     - `NettyTransportSpec` cannot bind `127.0.1.1` on this macOS host.
     - `JournalNoCompactionSpec` loads an x86-only LevelDB JNI library on this 
arm64 host and the fork exits with 255; the other 54 persistence tests passed.
     - `IntegrationDocTest` references `pekko.dispatch.UnboundedMailbox`; the 
same value is present on `origin/main` and fails with `ClassNotFoundException`.
     - the remote Multi-JVM aggregate ended with `No tests to run for MultiJvm` 
after executing its individual specs.
   - Qoder stdout review - No must-fix findings
   
   ### References
   
   Refs #1668
   
   - [JDK-8180450](https://bugs.openjdk.org/browse/JDK-8180450)
   


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