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
First I give you some details about my projects. I use Akka Streams and Akka Grpc to implement a data stream functionality. My code is written in Java. I have two main directions of streaming: receive data bytes from an interface (CAN, Ethernet etc.) -> convert it and create a message -> send it to the grpc server and receive messages from grpc server -> convert it and create data bytes -> send it to a device (CAN, Ethernet etc.).
Both data stream work fine and finally I wanted to give an extra function to close the connection with the grpc server properly (not with a for example Ctrl+C keyboard interrupt). Now I use two functions: SomeGrpcClient.close() and ActorSystem.terminate(). After close function I am waiting for the channel to be closed with the CompletableFuture.join() function. Every time it will be successfully closed and the join function immediately returns and then the program terminates the whole actor system.
This approach does not work with the first stream direction (receiving from an interface) but works fine with the second (receiving from grpc server) which I do not understand. In the first I use an infinite Source to listen to the interface and as I understand the grpc Source in the second is also an infinite Source. I expected a stream cancellation when using the grpc close function but after that it also continues sending messages to the server and when I terminate the actor system I get an exception on the client side: GraphStage [akka.grpc.internal.AkkaNettyGrpcClientGraphStage$$anon$1] terminated abruptly, caused by for example materializer or actor system termination
and get an error like this on the server side: ERROR a.g.j.GrpcExceptionHandler(akka://ActorSystem) - Unhandled error: [The connection closed with error: Connection reset]
akka.stream.StreamTcpException: The connection closed with error: Connection reset
I wrote this issue because I did not find a single one about this problem. Issue #212 is similar but it has been closed with the usage of shutdownNow function at version 0.2 and now I am using the 1.0.2 version. Tried with the latest also but the result is the same. My question is that this behaviour is normal and expected and the only working solution is to terminate the infinite Source with the for example Source.take() function?
Regards,
Boronyak
The text was updated successfully, but these errors were encountered:
Hi!
First I give you some details about my projects. I use Akka Streams and Akka Grpc to implement a data stream functionality. My code is written in Java. I have two main directions of streaming: receive data bytes from an interface (CAN, Ethernet etc.) -> convert it and create a message -> send it to the grpc server and receive messages from grpc server -> convert it and create data bytes -> send it to a device (CAN, Ethernet etc.).
Both data stream work fine and finally I wanted to give an extra function to close the connection with the grpc server properly (not with a for example Ctrl+C keyboard interrupt). Now I use two functions: SomeGrpcClient.close() and ActorSystem.terminate(). After close function I am waiting for the channel to be closed with the CompletableFuture.join() function. Every time it will be successfully closed and the join function immediately returns and then the program terminates the whole actor system.
This approach does not work with the first stream direction (receiving from an interface) but works fine with the second (receiving from grpc server) which I do not understand. In the first I use an infinite Source to listen to the interface and as I understand the grpc Source in the second is also an infinite Source. I expected a stream cancellation when using the grpc close function but after that it also continues sending messages to the server and when I terminate the actor system I get an exception on the client side:
GraphStage [akka.grpc.internal.AkkaNettyGrpcClientGraphStage$$anon$1] terminated abruptly, caused by for example materializer or actor system termination
and get an error like this on the server side:
ERROR a.g.j.GrpcExceptionHandler(akka://ActorSystem) - Unhandled error: [The connection closed with error: Connection reset]
akka.stream.StreamTcpException: The connection closed with error: Connection reset
I wrote this issue because I did not find a single one about this problem. Issue #212 is similar but it has been closed with the usage of shutdownNow function at version 0.2 and now I am using the 1.0.2 version. Tried with the latest also but the result is the same. My question is that this behaviour is normal and expected and the only working solution is to terminate the infinite Source with the for example Source.take() function?
Regards,
Boronyak
The text was updated successfully, but these errors were encountered: