The GitHub Actions job "Scalafmt" on 
pekko.git/fix/3459-demand-replenishment-regression has failed.
Run started by GitHub user He-Pin (triggered by He-Pin).

Head commit for run:
e4de67e7ba2962dc0d057d387194dec94eff8360 / 虎鸣 <[email protected]>
fix: process interpreter events between StageActor drain messages

Motivation:
LazyDispatch.drain() processes up to stage-actor-drain-batch (16)
messages in a tight loop within a single runAsyncInput call. Each
handler(item) may push an element (enqueuing a push event), but
interpreter.execute() is only called AFTER the entire drain completes.
This means messages 2..N see stale isAvailable(out)=false because the
pull from message 1's push has not propagated yet. External-source
stages using getStageActor (e.g. pekko-connectors UDP) silently drop
15/16 elements.

Modification:
Call interpreter.execute(2) after each handler(item) in the drain loop.
This processes the enqueued push event and propagates the pull via the
chase mechanism (push → onPush → pull → onPull → isAvailable=true),
replenishing demand before the next message is dispatched. The limit of
2 is sufficient: 1 event for the push + chase budget for the pull.

Result:
- Demand is replenished per-element for getStageActor-based stages
- Output batching (#3288) is fully preserved (3.59M ops/s, no regression)
- The coalescing optimization (N tells → 1 AsyncInput) is preserved
- UDP connector tests pass without modification

Tests:
- sbt "stream-tests / Test / testOnly org.apache.pekko.stream.FusingSpec" -- 
20/20 passed
- sbt "stream / mimaReportBinaryIssues" -- passed
- sbt "bench-jmh / Jmh / run -wi 1 -i 2 -w 3s -r 3s -f 1 -p asyncBoundaries=1 
.*AsyncBoundaryThroughputBenchmark.*" -- 3.59M ops/s (vs 3.55M on main, no 
regression)

References:
Fixes #3459

Report URL: https://github.com/apache/pekko/actions/runs/32702785160

With regards,
GitHub Actions via GitBox


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to