Skip to content

Commit

Permalink
When not being to find a gateway, changed error to warning closes 9133 (
Browse files Browse the repository at this point in the history
#9134)

* When not being to find a gateway, changed error to warning

as this situation could occur when the client starts faster than
the server

* Use structured logging

---------

Co-authored-by: Reuben Bond <[email protected]>
  • Loading branch information
rbuergi and ReubenBond authored Sep 30, 2024
1 parent c6a9d3a commit fdc1c5e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/Orleans.Core/Messaging/GatewayManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,11 @@ public async Task StartAsync(CancellationToken cancellationToken)
var knownGateways = await this.gatewayListProvider.GetGateways();
if (knownGateways.Count == 0)
{
var err = $"Could not find any gateway in {this.gatewayListProvider.GetType().FullName}. Orleans client cannot initialize.";
this.logger.LogError((int)ErrorCode.GatewayManager_NoGateways, err);
throw new SiloUnavailableException(err);
// this situation can occur if the client starts faster than the silos.
var providerName = this.gatewayListProvider.GetType().FullName;
this.logger.LogWarning((int)ErrorCode.GatewayManager_NoGateways, "Could not find any gateway in '{GatewayListProviderName}'. Orleans client cannot initialize until at least one gateway becomes available.", providerName);
var message = $"Could not find any gateway in '{providerName}'. Orleans client cannot initialize until at least one gateway becomes available.";
throw new SiloUnavailableException(message);
}

this.logger.LogInformation(
Expand Down

0 comments on commit fdc1c5e

Please sign in to comment.