Repository navigation
Conversation
Motivation: Repeatedly queueing the same mailbox ForkJoinTask can corrupt a fork-join work queue through task identity reuse. Exceptional completion can also prevent later submissions of that mailbox from running. Modification: Adapt apache#3621 so both the Java 8 and Java 9+ Pekko fork-join executors wrap every Runnable submission in a fresh PekkoForkJoinTask. Retain Mailbox's ForkJoinTask superclass and methods for 1.x binary compatibility. Share the resubmission regression tests across both executor implementations, wire TestJdk9 to the actor module's CompileJdk9 output, and document the built-in executor scope. Result: Each built-in fork-join submission has an independent task identity and completion state. Mailbox's binary shape is unchanged and no MiMa filters are needed. Tests: - Both regression suites fail on the original executor code and pass with the fix. Each pre-fix suite reports one expected failure and one pass. - Cross-Scala focused regression suites: 12 passed across 2.12.21, 2.13.18, and 3.3.7, covering Test and TestJdk9. - Runtime checks: 2 tests passed on JDK 8; both executor suites passed on JDK 25 (4 tests), using JDK 17 to compile the latter. - Dispatcher, Mailbox, ForkJoin, and ActorSystem focused tests: 190 passed, 2 existing pending tests, on JDK 17. - +mimaReportBinaryIssues and +headerCheckAll passed for all Scala versions. - headerCreateAll, scoped sortImports, native scalafmt for the changed files, and git diff --check passed. - docs/paradox passed with -J--add-opens=java.base/java.lang=ALL-UNNAMED. The first JDK 17 attempt failed on the existing Parboiled reflective access requirement; the retry with the JVM option passed. - checkCodeStyle fails on the pre-existing formatting of remote/src/test/scala/org/apache/pekko/remote/serialization/NestedPayloadDepthSpec.scala. That file matches origin/1.8.x byte for byte and is outside this change. - An initial MiMa attempt failed with no disk space; the final full run passed after space recovered and build concurrency was limited to 2. - Initial cross-JDK launcher attempts hit Java 8 argument-file and JDK 25 javac -Werror setup issues; final native-JDK-8 and runtime-only-JDK-25 checks passed without changing repository build settings. - PR_TARGET_BRANCH=origin/1.8.x validatePullRequest completed but failed: native LevelDB JNI does not include the host's Apple Silicon architecture, and the host cannot bind the 127.0.1.1 address used by a Netty test. It also reported two TcpConnectionSpec timeouts and one FlowFlatMapConcatParallelismSpec future timeout under the full run. - Both TCP cases passed individually on the original 1.8.x code and on the fixed executors in an isolated worktree. The failed reads use CallingThreadDispatcher, not the modified fork-join submission path. - FlowFlatMapConcatParallelismSpec passed all 387 tests when rerun with ScalaTest Runner on JDK 17 using sbt's exported test classpath and the same test time factor. No assertions or timeouts were changed. - Qoder stdout review: No must-fix findings. References: Refs apache#3621, apache#3620, akka/akka-core#33019.
Member
Author
|
I think it's better just do it as 2.0.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Backport #3621 to
1.8.x. Repeatedly submitting the same mailbox as aForkJoinTaskcan corrupt a fork-join work queue through task identity reuse. Exceptional completion can also prevent subsequent submissions of that mailbox from running.Modification
execute(Runnable)submissions in a freshPekkoForkJoinTaskin both Pekko's Java 8 and Java 9+ fork-join executors.Mailbox extends ForkJoinTaskand its existing methods for 1.x binary compatibility.Runnablecontrol. WireTestJdk9to the actor module'sCompileJdk9output.Result
Every submission through Pekko's built-in fork-join executors has an independent task identity and completion state. The mailbox binary shape is unchanged and no MiMa filters are needed. Custom executors that submit mailboxes directly to a raw JDK
ForkJoinPoolremain outside this backport's scope.Tests
TestandTestJdk9.+mimaReportBinaryIssues,+headerCheckAll,headerCreateAll, scopedsortImports, native scalafmt for changed files, andgit diff --checkpassed.docs/paradoxpassed with-J--add-opens=java.base/java.lang=ALL-UNNAMEDafter the initial JDK 17 reflective-access failure. Initial disk-space and cross-JDK launcher/compiler setup failures were resolved before the successful checks above.checkCodeStylefails on pre-existing formatting inremote/src/test/scala/org/apache/pekko/remote/serialization/NestedPayloadDepthSpec.scala; that file is identical toorigin/1.8.x.PR_TARGET_BRANCH=origin/1.8.x validatePullRequestcompleted but was not fully green. LevelDB JNI lacks support for the Apple Silicon host, a Netty test cannot bind127.0.1.1, and the aggregate run reported twoTcpConnectionSpectimeouts and oneFlowFlatMapConcatParallelismSpectimeout.References
Refs #3621, #3620.