Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: retry transient connection errors #27

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

neon-sunset
Copy link
Collaborator

Caught connection error:

System.Net.WebSockets.WebSocketException: The server returned status code '502' when status
code '101' was expected.
  at void System.Net.WebSockets.WebSocketHandle.ValidateResponse(HttpResponseMessage response,
     string secValue)
  at async Task System.Net.WebSockets.WebSocketHandle.ConnectAsync(Uri uri, HttpMessageInvoker
     invoker, CancellationToken cancellationToken, ClientWebSocketOptions options)
  at async Task System.Net.WebSockets.ClientWebSocket.ConnectAsyncCore(Uri uri,
     HttpMessageInvoker invoker, CancellationToken cancellationToken)
  at async ValueTask<WebSocket>
     Microsoft.AspNetCore.Http.Connections.Client.Internal.WebSocketsTransport.
     DefaultWebSocketFactory(WebSocketConnectionContext context, CancellationToken
     cancellationToken)
  at async Task Microsoft.AspNetCore.Http.Connections.Client.Internal.WebSocketsTransport.
     StartAsync(Uri url, TransferFormat transferFormat, CancellationToken cancellationToken)
  at async Task Microsoft.AspNetCore.Http.Connections.Client.HttpConnection.StartTransport(Uri
     connectUrl, HttpTransportType transportType, TransferFormat transferFormat,
     CancellationToken cancellationToken)
  at async Task Microsoft.AspNetCore.Http.Connections.Client.HttpConnection.
     SelectAndStartTransport(TransferFormat transferFormat, CancellationToken cancellationToken
     )
  at async Task Microsoft.AspNetCore.Http.Connections.Client.HttpConnection.StartAsyncCore(
     TransferFormat transferFormat, CancellationToken cancellationToken)
  at async Task Microsoft.AspNetCore.Http.Connections.Client.HttpConnection.StartAsync(
     TransferFormat transferFormat, CancellationToken cancellationToken)
  at async ValueTask<ConnectionContext>
     Microsoft.AspNetCore.Http.Connections.Client.HttpConnectionFactory.ConnectAsync(EndPoint
     endPoint, CancellationToken cancellationToken)
  at async ValueTask<ConnectionContext>
     Microsoft.AspNetCore.Http.Connections.Client.HttpConnectionFactory.ConnectAsync(EndPoint
     endPoint, CancellationToken cancellationToken)
  at async Task Microsoft.AspNetCore.SignalR.Client.HubConnection.StartAsyncCore(
     CancellationToken cancellationToken)
  at async Task Microsoft.AspNetCore.SignalR.Client.HubConnection.StartAsyncInner(
     CancellationToken cancellationToken)
  at async Task Microsoft.AspNetCore.SignalR.Client.HubConnection.StartAsync(CancellationToken
     cancellationToken)
  at async Task<HubConnection> BingChat.BingChatConversation.Connect(CancellationToken ct) in
     /home/runner/work/BingChat/BingChat/src/BingChat/BingChatConversation.cs:181
[TRUNCATED]

Possibly related to previously discussed interaction with Azure load balancer and SignalR.
For now, we can simply retry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant