File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -85,8 +85,7 @@ public async Task<TReply> AskAsync<TRequest, TReply>(
8585 _outstanding [ request ] = 0 ;
8686
8787 using var registration = cancellationToken . Register (
88- static state => ( ( IActorRequestCore ) state ! ) . Fail ( new OperationCanceledException ( ) ) ,
89- request
88+ ( ) => request . Fail ( new OperationCanceledException ( cancellationToken ) )
9089 ) ;
9190
9291 try
@@ -129,7 +128,7 @@ private async Task ProcessAsync(TMessage message)
129128 {
130129 if ( message is IActorRequestCore cancelledRequest )
131130 {
132- cancelledRequest . Fail ( new OperationCanceledException ( ) ) ;
131+ cancelledRequest . Fail ( new OperationCanceledException ( _shutdown . Token ) ) ;
133132 }
134133 }
135134 catch ( Exception ex )
@@ -152,6 +151,11 @@ private async Task ProcessAsync(TMessage message)
152151
153152 if ( _options . ErrorPolicy == ActorErrorPolicy . StopOnError )
154153 {
154+ foreach ( var pending in _outstanding . Keys )
155+ {
156+ pending . Fail ( new InvalidOperationException ( "Actor stopped due to a handler failure." , ex ) ) ;
157+ }
158+
155159 throw ;
156160 }
157161 }
You can’t perform that action at this time.
0 commit comments