-
Notifications
You must be signed in to change notification settings - Fork 193
Description
The pekko.stream.materializer.subscriber-timeout default setting (mode="cancel") cancels the publisher, which results in a termination exception in the stream, but the reason is not propagated. This is already discussed in akka/akka-core#28926, but it also happens without preMaterialization, e.g. when the system is under heavy load during the materialization.
It's quite hard to debug this, because the exception does not convey enough information, and it happens non-deterministically.
Some ideas:
Adding another option (cancel-and-warn) does not seem right, and it breaks compatibility. So does changing the configuration to have 2 separate settings (cancel-on-timeout, warn-on-timeout). In both cases, public API types would need to change.
This non-informative part actually occurs in FanOutProcessorImpl: When the timeout happens, it cancels instead of failing, and future subscribers are only notified about the abrupt termination. I thought I could fix it there - instead of canceling, it would call fail(), notifying the outputs with an exception that contains the information that there had been a timeout. But this also breaks compatibility - the AbruptTerminationException which is currently thrown explicitly sets cause to null, so I can't call initCause. I'd have to change the signature.