This is an automated email from the ASF dual-hosted git repository. He-Pin pushed a commit to branch fix-jdk21-fjp-configuration in repository https://gitbox.apache.org/repos/asf/pekko.git
commit 0de42463fd8230d56a459f3cebd6379b7cb99222 Author: He-Pin <[email protected]> AuthorDate: Sun Apr 19 02:20:54 2026 +0800 fix: use LIFO task-peeking-mode in stream test dispatcher for JDK 21+ FJP regression Motivation: JDK-8300995 documented a ForkJoinPool regression in JDK 21+: with asyncMode=true (FIFO, the Pekko default), compensation threads are not created promptly when workers block, leading to cascading delays in actor round-trip workloads (e.g. MergeHub buffer=1 requires one full actor hand-off per element). With FIFO ordering, the response task for an actor round-trip is enqueued at the *back* of the work queue and must wait behind all pending tasks, amplifying latency under load. JDK 25 CI showed this most severely (20K-element HubSpec tests timing out on a 6-minute timeout). Modification: Set task-peeking-mode = "LIFO" on pekko.test.stream-dispatcher so that each worker places response tasks at the *front* of its local deque, resolving round-trips immediately without triggering the JDK 21+ compensation-thread machinery. Actor mailbox FIFO ordering is unaffected — UnboundedMailbox queues are always FIFO regardless of dispatcher task-peeking-mode. Result: HubSpec 48/48 pass; the dispatcher-level LIFO avoids the asyncMode compensation regression for actor-heavy stream tests, making the test suite more robust on JDK 21+ (and especially JDK 25) without requiring further reductions in test element counts. Co-authored-by: Copilot <[email protected]> --- stream-testkit/src/test/resources/reference.conf | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/stream-testkit/src/test/resources/reference.conf b/stream-testkit/src/test/resources/reference.conf index 990b427747..73787a6378 100644 --- a/stream-testkit/src/test/resources/reference.conf +++ b/stream-testkit/src/test/resources/reference.conf @@ -14,6 +14,13 @@ pekko.test.stream-dispatcher { fork-join-executor { parallelism-min = 8 parallelism-max = 8 + # Use LIFO (stack-order) task peeking to reduce ForkJoinPool compensation-thread + # latency on JDK 21+. With the default FIFO mode (asyncMode=true), actor round-trips + # (e.g. MergeHub buffer=1) enqueue response tasks at the back of the work queue, + # causing cascading delays under load — a known regression tracked in JDK-8300995. + # LIFO puts response tasks at the front of each worker's deque so they are picked + # up immediately; actor mailbox ordering is unaffected (UnboundedMailbox is always FIFO). + task-peeking-mode = "LIFO" } mailbox-requirement = "org.apache.pekko.dispatch.UnboundedMessageQueueSemantics" } --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
