-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
Version Information
Version of Akka.NET? 1.5.38
Which Akka.NET Modules? Akka.Streams
Describe the bug
Related issues:
BaseByteArrayJournalDaolacks resiliency against stream failure Akka.Persistence.Sql#497- Stream cancellation exception can be null Akka.Persistence.Sql#498
- Stream upstream error propagation can fail in async calls #7432
This has been observed inside the Akka.Persistence.Sql plugin, where this SelectAsync stage suddenly stopped working due to ArgumentException "Cancellation cause must not be null (Parameter 'cause')":
Note that the SelectAsync code body is running inside a try...catch block.
We've fixed the symptom here: #7433 and here: #7497 , but the problem still persists, causing the Akka.Persistence.Sql write journal to stop working completely for some user with StreamDetachedException "Stream is terminated. Materialized value is detached.", the same symptom seen in akkadotnet/Akka.Persistence.Sql#497 . So far, we tried to keep the write journal going by introducing a Restart decider, but logically, we shouldn't need it; the stream should've kept going until the process stops with no errors.
Something in Akka.Streams is stopping the stream with null exception as the cause of the stop. The only point where exceptions can start to bubble up the stream stages is here inside the GraphInterpreter class:
| connection.OutHandler.OnDownstreamFinish(cause); |
Akka.Streams that can cause a stage cancellation that can explain the original symptom. Code review so far hasn't found any probable site where and/or when a null can possibly be injected into this code.