Skip to content

Conversation

@johanandren
Copy link
Contributor

private val streamDone = source.run()
private val streamDone = source
.via(projectionState.killSwitch.flow)
.run()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

An alternative I tried here is to give it a bit of time to possibly write in flights completed offsets etc:

source
.viaMat(KillSwitches.single)(Keep.right)
      .mapMaterializedValue { killSwitch =>
        import system.executionContext
        projectionState.abort.future.onComplete(_ =>
          akka.pattern.after(1.second)(Future {
            killSwitch.abort(AbortProjectionException)
          }))
      }
      .run()

But I don't think it is worth it, better to just shut down as fast as possible.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not quite sure why it is needed in this scenario, it should work anyway, but the test failed until I added this faster downstream killswitch. I'll investigate that a bit more.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Aah, ofc, it's no surprise at all, killswitch going downstream is just completion, which travels in order with the events. So if backpressuring the completion will get stuck.

@johanandren johanandren marked this pull request as ready for review November 25, 2025 11:06
@johanandren
Copy link
Contributor Author

If we instead submaterialize replays, we won't need this.

@johanandren johanandren marked this pull request as draft November 27, 2025 10:11
@johanandren
Copy link
Contributor Author

No longer relevant because of #1385

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.

2 participants