He-Pin opened a new pull request, #3185:
URL: https://github.com/apache/pekko/pull/3185
### Motivation
Issue #3110 tracks stream operators that should honor `SupervisionStrategy`
for user functions.
`expand` called the user-provided expansion logic without supervision, so
exceptions failed the stream unconditionally. Since `extrapolate` is
implemented via `Expand`, the same gap applied there too.
### Modification
- Added supervision handling in `Expand` for:
- failures while creating extrapolation from an incoming element
- failures while evaluating iterator paths (`hasNext` / `next`)
- Supervision semantics:
- `Stop`: fail stage
- `Resume`: drop failed element and continue
- `Restart`: drop failed element, reset current extrapolation state,
continue
- Updated Scala/Java API docs (`Flow`, `Source`, `SubFlow`, `SubSource`) to
describe supervision behavior and clarify Resume vs Restart for `expand`.
- Updated operator docs:
- `expand.md`
- `extrapolate.md`
- Added directional regression tests:
- `FlowExpandSpec`: Stop/default Stop/Resume/Restart + iterator-evaluation
failure paths
- `FlowExtrapolateSpec`: Stop/Resume/Restart for extrapolator failures
during iterator evaluation
### Result
`expand` and `extrapolate` now honor `ActorAttributes.SupervisionStrategy`
for user-function failures with explicit regression coverage for exceptional
iterator paths.
which is now Apache licensed
### Tests
- `sbt "stream-tests/Test/testOnly
org.apache.pekko.stream.scaladsl.FlowExpandSpec
org.apache.pekko.stream.scaladsl.FlowExtrapolateSpec"` (23/23 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]