-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
[SignalR] Cannot use InvokeAsync While there is an stream ongoing in SignalR #46503
Comments
Please provide a minimal repro project as a github repository. |
Hi @SLjavad. 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. |
https://github.com/SLjavad/SignalRStreamTest i have provided this repo for testing. run
as you can see stream closes after clicking on |
Thanks for the repro, I had tried to repro with the javascript app, but because of how the issue occurs it would have taken an extra step to occur with the javascript client. The problem is that the server generated InvocationID conflicts with the client generated StreamID, so an invocation result can complete a stream accidentally
If using the Redis backplane this can't occur because we generate a random ID every invocation instead of an incrementing number that starts at 0.
We might want to switch to this method for the in-memory implementation too so that collisions can't occur with streams. |
Thanks , it worked using Redis backplane. |
It's not the hub method invocation ID (2 in your logs), it's the ID generated by the server that waits for a client response, since you're using client results. So if you didn't use client results, you couldn't hit this issue. |
ah .. got it .. you're right , thanks for clarifying |
Do we need to patch this? |
Yep |
Is there an existing issue for this?
Describe the bug
i have an stream from client to server using SignalR.
stream channel closes and completes when i invoke a client method from server and server program does not continue from InvokeAsync line.
this is server side streaming code that reads the stream channel :
and this is a server method that invokes a client method:
the program will not continue from the line
await Clients.Caller.InvokeAsync<bool>("stream_handshake", "some-data", token.Token);
and my stream closes suddenlyExpected Behavior
streaming and invoking a client method are two separate actions.
so Invoking shouldn't affect streaming.
streaming should be continued and server can invoke any method of client it wants.
These are two different actions and have nothing to do with each other.
Steps To Reproduce
No response
Exceptions (if any)
No response
.NET Version
7.0.100
Anything else?
No response
The text was updated successfully, but these errors were encountered: