You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello
I've found what listening sock might not be released, since scalapb.zio_grpc.Server.ServiceImpl releas underlying io.grpc.Server with io.grpc.Server#shutdown method
Should scalapb.zio_grpc.Server.ServiceImpl#toManaged releas with io.grpc.Server#shutdownNow instead?
Is there a good reason not to do this?
Or maybe a pull request for more flexible behavior would be more appropriate ?
Reproducing description:
proto file
syntax = "proto3";
package examples;
message Request {
string name = 1;
bytes data = 2;
}
message Empty {}
service TransportService {
rpc Transmit(stream Request) returns (Empty) ;
}
lsof -i :9000
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
java 476816 pavel 85u IPv6 5566989 0t0 TCP localhost:9000->localhost:35922 (ESTABLISHED)
java 476892 pavel 81u IPv6 5565078 0t0 TCP localhost:35922->localhost:9000 (ESTABLISHED)
And the client application will not be notified in any way about the server shutdown.
Socket will be released and client will stop only after killing the entire server application (kill -9 476816 for my example )
The text was updated successfully, but these errors were encountered:
Just to add to this, it seems counter-intuitive that shutdown on the underlying channel returns when the shutdown has started and not completed. In the ZIO/effect world of async, it could be more useful to start shutdown then return the result of io.grpc.ManagedChannel.awaitTermination using blocking effect. That way normal idiomatic things like channel.shutdown.race(ZIO....) can be used. The downside of this is that ManagedChannel.shutdown doesn't force clients to disconnect, so shutdownNow could perhaps be used if the user passes a parameter forceShutdownNow to the ZChannel shutdown method.
Alternatively ZChannel could expose awaitShutdown which provides a thinner abstraction, but less idiomatic. Do you have an opinion @thesamet? If either solution works for you, I could create an MR
In the ZIO/effect world of async, it could be more useful to start shutdown then return the result of io.grpc.ManagedChannel.awaitTermination using blocking effect.
I agree. Will be open to a PR that makes the shutdown effect more idiomatic.I am also ok with exposing the low-level methods but they should be presented as such so only users that want more control will use them.
Hello
I've found what listening sock might not be released, since scalapb.zio_grpc.Server.ServiceImpl releas underlying io.grpc.Server with io.grpc.Server#shutdown method
Should scalapb.zio_grpc.Server.ServiceImpl#toManaged releas with io.grpc.Server#shutdownNow instead?
Is there a good reason not to do this?
Or maybe a pull request for more flexible behavior would be more appropriate ?
Reproducing description:
proto file
Server
Client
After server "zio app done" socket still exists
And the client application will not be notified in any way about the server shutdown.
Socket will be released and client will stop only after killing the entire server application (kill -9 476816 for my example )
The text was updated successfully, but these errors were encountered: