He-Pin opened a new pull request, #3187:
URL: https://github.com/apache/pekko/pull/3187
### Motivation
Issue #3110 tracks stream operators that should honor `SupervisionStrategy`
for user callbacks.
`aggregateWithBoundary` executes several user callbacks (`allocate`,
`aggregate`, `harvest`, timer predicate), but callback exceptions were not
supervised and failed the stream unconditionally.
### Modification
- Added supervision handling in `AggregateWithBoundary` for all callback
sites:
- `allocate` / `aggregate` in `onPush`
- timer predicate and `harvest` in `onTimer`
- `harvest` in `onUpstreamFinish`
- Supervision behavior:
- `Stop` → fail stage
- `Resume` / `Restart` → drop failing element or aggregate and continue
- For `aggregate` callback failures under `Resume`, reset aggregate state to
avoid retaining partially-mutated mutable state.
- Updated Scala/Java API docs and operator docs (`aggregateWithBoundary.md`)
to describe supervision behavior.
- Added directional tests in `AggregateWithBoundarySpec` (including
simulated-timer coverage) for:
- aggregate failures (`Resume` / `Restart`)
- allocate failure (`Resume`)
- harvest failure (`Resume`)
- timer predicate failure (`Resume`)
### Result
`aggregateWithBoundary` now honors `ActorAttributes.SupervisionStrategy`
across all user callback failure points with regression coverage for
push/timer/finish paths.
which is now Apache licensed
### Tests
- `sbt "stream-tests/Test/testOnly
org.apache.pekko.stream.scaladsl.AggregateWithBoundarySpec
org.apache.pekko.stream.scaladsl.AggregateWithTimeBoundaryAndSimulatedTimeSpec"`
(11/11 passed)
- `sbt "stream/mimaReportBinaryIssues"` (clean)
- `sbt "docs/paradox"` (passed)
### References
Refs #3110
--
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]