Skip to content

Commit

Permalink
Filtered rusi rpc status codes for host restart (#190)
Browse files Browse the repository at this point in the history
  • Loading branch information
fraliv13 authored Nov 9, 2021
1 parent f36b431 commit a2876ec
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Messaging/NBB.Messaging.Rusi/RusiMessagingTransport.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public async Task<IDisposable> SubscribeAsync(string topic, Func<TransportReceiv
{
try
{
await foreach (var msg in subscription.ResponseStream.ReadAllAsync())
await foreach (var msg in subscription.ResponseStream.ReadAllAsync(cancellationToken))
{
var receiveContext = new TransportReceiveContext(
new TransportReceivedData.PayloadBytesAndHeaders(msg.Data.ToByteArray(), msg.Metadata));
Expand All @@ -118,7 +118,7 @@ public async Task<IDisposable> SubscribeAsync(string topic, Func<TransportReceiv
});
}
}
catch (RpcException ex)
catch (RpcException ex) when (new[] { StatusCode.Unavailable, StatusCode.Aborted }.Contains(ex.StatusCode))
{
_logger.LogError(ex, "Rusi transport unrecoverable exception");

Expand Down

0 comments on commit a2876ec

Please sign in to comment.