-
Notifications
You must be signed in to change notification settings - Fork 124
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
Client close doesn't kill stream on server #212
Comments
Hi Peter, thanks for the feedback! It is indeed correct that Can you tell a bit more about your use case? Typically I'd say gRPC clients might be long-running processes, what is your reason for closing it? Are you winding down the entire application? Would you want/expect to cancel both existing and new calls to be shut down on close? |
Hi Arnout. I my use case the client should ideally also be long-running. However, I have a variable amount of actors that get spawned at different times subscribing to multiple different quotes. And they also get torn down frequently. But, when all the actors using a specific quote stops, I would like to be able to stop the specific quote currently streaming. I hope I'am clear. Otherwise just ask :) |
I think ideally terminating the stream should indeed close it all the way to the server - it's entirely possible that that is not currently the case yet, but I think I'd consider that a bug - possibly also related to the changes currently going on in #201. |
Yes. Unfortunately, it doesn't seem to close the stream on the server. |
I started looking at this. It's correct that the streaming calls continue when after we have done We could also install KillSwitch in the streams if that is a more graceful way to close things. I'm not sure what we would want to support?
Perhaps the full graceful shutdown (without KillSwitch) might be difficult to implement later when we switch to Akka HTTP client? I think I'll start by simply changing it to This is perhaps also related to my comment about exposing the client close state in https://github.com/akka/akka-grpc/pull/260/files#r199136901 When we are at it I think we should call channel.shutdownNow when the actor system has terminated. |
* and close client when ActorSystem has terminated
Furthermore, it would be nice if I could close a specific stream without closing the client. Right now if I KillSwitch an infinite stream, it continues streaming on the server-side |
Sorry, I can confirm that KillSwitching works for an infinite stream |
@peteremiljensen I think #264 should resolve the issue - feel free to reopen (or open a new ticket) when you have any further comments though! |
Sounds good. Than you very much |
I've a question. The server streams out stock quotes to a client.
But I can't seem to close the stream again. If calling
client.close
on the client-side, then the server stil streams quotes. It only stops if I terminate the client.Is client.close not closing any living connections? Or am I misunderstanding something?
Thank you :)
The text was updated successfully, but these errors were encountered: