.NET event sourcing library with CosmosDB, DynamoDB, EventStoreDB, message-db, SqlStreamStore and integration test backends. Focused at stream level; see https://github.com/jet/propulsion for cross-stream projections/subscriptions/reactions
Where the request being processed via the read through cache mechanism gets Cancelled (via CancellationTokenSource, but also via things like Async.Parallel's cancellation of sibling requests), the Task held within the LazyTask ends up in Cancelled state, not the more typical IsFaulted.
This leads to incorrect re-use of the cached value (as held within the cell).
This in turn leads to any request with AnyCachedValue (or AllowStale) in 4.0.0 failing with TaskCancelledException for as long as that cache entry lives.
While this is a relatively obvious mistake, the issue is only reproducable with very heavy parallism - and it's only in cache read through mode (allowStale > TimeSpan.Zero) that this comes into play.
Where the request being processed via the read through cache mechanism gets
Cancelled
(viaCancellationTokenSource
, but also via things likeAsync.Parallel
's cancellation of sibling requests), theTask
held within theLazyTask
ends up inCancelled
state, not the more typicalIsFaulted
.This leads to incorrect re-use of the cached value (as held within the cell).
This in turn leads to any request with
AnyCachedValue
(orAllowStale
) in4.0.0
failing withTaskCancelledException
for as long as that cache entry lives.While this is a relatively obvious mistake, the issue is only reproducable with very heavy parallism - and it's only in cache read through mode (
allowStale > TimeSpan.Zero
) that this comes into play.