File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed
src/ServiceControl.Audit/Auditing Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -80,7 +80,10 @@ public async Task Ingest(List<MessageContext> contexts)
8080
8181 foreach ( var context in contexts )
8282 {
83- context . GetTaskCompletionSource ( ) . TrySetResult ( true ) ;
83+ if ( ! context . GetTaskCompletionSource ( ) . TrySetResult ( true ) )
84+ {
85+ Log . Warn ( "TrySetResult failed" ) ;
86+ }
8487 }
8588 }
8689 catch ( Exception e )
Original file line number Diff line number Diff line change @@ -229,7 +229,10 @@ void ProcessSagaAuditMessage(MessageContext context)
229229 }
230230
231231 // releasing the failed message context early so that they can be retried outside the current batch
232- context . GetTaskCompletionSource ( ) . TrySetException ( e ) ;
232+ if ( ! context . GetTaskCompletionSource ( ) . TrySetException ( e ) )
233+ {
234+ Logger . Warn ( "ProcessSagaAuditMessage TrySetException failed" ) ;
235+ }
233236 }
234237 }
235238
@@ -297,7 +300,10 @@ await messageDispatcher.Value.Dispatch(new TransportOperations(messagesToEmit.To
297300 }
298301
299302 // releasing the failed message context early so that they can be retried outside the current batch
300- context . GetTaskCompletionSource ( ) . TrySetException ( e ) ;
303+ if ( ! context . GetTaskCompletionSource ( ) . TrySetException ( e ) )
304+ {
305+ Logger . Warn ( "ProcessAuditMessage TrySetException failed" ) ;
306+ }
301307 }
302308 }
303309
You can’t perform that action at this time.
0 commit comments