dotnet / aspnetcore

ASP.NET Core is a cross-platform .NET framework for building modern cloud-based web applications on Windows, Mac, or Linux.
https://asp.net
MIT License
35.6k stars 10.06k forks source link

Java Client for SignalR - Invoking 'onClosed' method failed #41579

Closed the-mod closed 2 years ago

the-mod commented 2 years ago

Is there an existing issue for this?

Describe the bug

Hi there,

I am running SignalR Client for Java in Version 6.0.3.

I saw in our Logs, that SignalR Connection somehow crasht and the onClosed Handler wasn't called.

The Error Message coming from the SDK was Unexpected status code returned from negotiate: 502 ., Invoking 'onClosed' method failed in Class com.microsoft.signalr.HubConnection at Method stopConnection.

Stacktrace:

com.microsoft.signalr.HttpRequestException:
   at com.microsoft.signalr.HubConnection.lambda$handleNegotiate$1 (HubConnection.java:172)
   at io.reactivex.rxjava3.internal.operators.single.SingleMap$MapSingleObserver.onSuccess (SingleMap.java:58)
   at io.reactivex.rxjava3.subjects.SingleSubject.onSuccess (SingleSubject.java:141)
   at com.microsoft.signalr.DefaultHttpClient$2.onResponse (DefaultHttpClient.java:156)
   at okhttp3.internal.connection.RealCall$AsyncCall.run (RealCall.kt:519)
   at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1136)
   at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:635)
   at java.lang.Thread.run (Thread.java:833)

It seams to me, the Connection to SignalR was then closed.

Before that some other Error occured: java.io.EOFException, java.io.EOFException at okio.RealBufferedSource.require at com.microsoft.signalr.OkHttpWebSocketWrapper on Method onFailure

Stacktrace:

java.io.EOFException:
   at okio.RealBufferedSource.require (RealBufferedSource.kt:199)
   at okio.RealBufferedSource.readByte (RealBufferedSource.kt:209)
   at okhttp3.internal.ws.WebSocketReader.readHeader (WebSocketReader.kt:119)
   at okhttp3.internal.ws.WebSocketReader.processNextFrame (WebSocketReader.kt:102)
   at okhttp3.internal.ws.RealWebSocket.loopReader (RealWebSocket.kt:293)
   at okhttp3.internal.ws.RealWebSocket$connect$1.onResponse (RealWebSocket.kt:195)
   at okhttp3.internal.connection.RealCall$AsyncCall.run (RealCall.kt:519)
   at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1136)
   at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:635)
   at java.lang.Thread.run (Thread.java:833)

Expected Behavior

Expected Behavior would be to call at least the onClosed Handler, where a reconnection could be handled.

Steps To Reproduce

No response

Exceptions (if any)

No response

.NET Version

java17

Anything else?

No response

BrennanConroy commented 2 years ago

Couple things here:

If you're seeing behavior that doesn't match that, please be specific about what it is.

ghost commented 2 years ago

Hi @the-mod. We have added the "Needs: Author Feedback" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

the-mod commented 2 years ago

Thanks for the fast feedback. I see the Points and will increase my Code. The Issue can be closed