Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use SubstreamStrategy.propagate to complete substream on Exception #223

Merged
merged 1 commit into from
May 11, 2022

Conversation

mdedetrich
Copy link
Contributor

@mdedetrich mdedetrich commented May 10, 2022

About this change - What it does

Turns out it is possible to cancel the parent stream when using a Subflow with a SubstreamCancelStrategy

Resolves: #221

Why this way

The overloaded .splitAfter method has a SubstreamCancelStrategy parameter which defaults to .drain If we use .propagate then we get the desired behavior however if an exception is thrown we still need to log it since SupervisionStategy is still ignored (see upstream akka/akka#31394 for more context)

@coveralls
Copy link

Pull Request Test Coverage Report for Build 2303442584

  • 3 of 3 (100.0%) changed or added relevant lines in 1 file are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage increased (+0.3%) to 75.477%

Files with Coverage Reduction New Missed Lines %
core-s3/src/main/scala/io/aiven/guardian/kafka/s3/Config.scala 1 90.63%
Totals Coverage Status
Change from base Build 2301181142: 0.3%
Covered Lines: 277
Relevant Lines: 367

💛 - Coveralls

case End => true
case _ => false
}
.splitAfter(SubstreamCancelStrategy.propagate) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@mdedetrich mdedetrich merged commit 8afabed into main May 11, 2022
@mdedetrich mdedetrich deleted the use-substreamcancelstrategy-propagate branch May 11, 2022 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Exceptions thrown inside of SubFlow don't cancel entire stream when using SupervisionStrategy.Stop
3 participants