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

   ## Motivation
   
   The JDK 25 nightly build aborts the stream TCK with:
   
   ```
   [CoordinatedShutdown(pekko://InputStreamSourceTest)] Coordinated shutdown 
phase [actor-system-terminate] timed out after 10000 milliseconds
   java.lang.RuntimeException: Failed to stop [InputStreamSourceTest] within 
[40000 milliseconds]
   ```
   
   The `printTree` dump shows two `flow-X-0-take` `ActorGraphInterpreter`
   children stuck mid-termination under `StreamSupervisor-0`.
   
   `InputStreamSourceTest` feeds a CPU-busy `InputStream` whose `read()`
   always returns a fresh byte without blocking or yielding, so each
   `onPull` runs up to `chunkSize` synchronous `read()` calls. The JDK 25
   nightly forces 
`pekko.test.stream-dispatcher.fork-join-executor.virtualize=on`
   (see `.github/workflows/nightly-builds.yml`), which is the very
   dispatcher the test pins via `ActorAttributes.dispatcher(...)`. On a
   virtualized dispatcher, cancellation propagation through `take(elements)`
   is slow enough that the default 10 s `actor-system-terminate` phase
   timeout fires before the lingering flow actors finish terminating, even
   though the outer `ActorSystemLifecycle.shutdownTimeout` is already
   scaled to 40 s by `pekko.test.timefactor` (#2885).
   
   ## Modification
   
   Override `additionalConfig` in `InputStreamSourceTest` to bump
   `pekko.coordinated-shutdown.phases.actor-system-terminate.timeout` to
   30 s, mirroring the pattern already used in `MixedProtocolClusterSpec`
   for the same JDK 25 virtualized failure mode. The override layers on top
   of `PekkoPublisherVerification.additionalConfig` via `withFallback` so
   the existing buffer-size settings are preserved.
   
   This is the smallest viable fix — it does not change production code,
   does not alter the test's semantics, and does not relax any other
   TCK timing.
   
   ## Result
   
   The phase has enough headroom to drain in-flight cancellation traffic on
   virtualized dispatchers before the outer shutdown await fires. The other
   TCK tests are untouched and keep their default 10 s phase timeout.
   
   ## Tests
   
   Locally on `Oracle OpenJDK 25.0.2` (arm64) with the same flags as
   `nightly-builds.yml jdk-nightly-build`:
   
   ```bash
   sbt \
     -Dpekko.test.timefactor=4 \
     -Dpekko.actor.testkit.typed.timefactor=4 \
     -Dpekko.test.stream-dispatcher.fork-join-executor.virtualize=on \
     -Dpekko.test.stream-dispatcher.fork-join-executor.minimum-runnable=8 \
     -Dpekko.actor.default-dispatcher.fork-join-executor.virtualize=on \
     -Dpekko.actor.default-dispatcher.fork-join-executor.minimum-runnable=8 \
     -Dpekko.actor.internal-dispatcher.fork-join-executor.virtualize=on \
     -Dpekko.actor.internal-dispatcher.fork-join-executor.minimum-runnable=8 \
     "project stream-tests-tck" \
     "testOnly org.apache.pekko.stream.tck.InputStreamSourceTest"
   ```
   
   Result: 26 passing / 0 failing / 12 canceled (TCK optional multi-subscriber 
specs).
   
   `scalafmt` was run against the edited file.
   
   ## References
   
   - `.github/workflows/nightly-builds.yml` `jdk-nightly-build` matrix 
javaVersion=25
   - #2885 — prior fix that scaled the outer TCK shutdown timeout by 
`pekko.test.timefactor`
   - #2925 — prior fix for virtualized dispatcher shutdown ordering
   - 
`cluster/src/test/scala/org/apache/pekko/cluster/MixedProtocolClusterSpec.scala:40`
 — same pattern for JDK 25 virtualized failures


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