A client spawned inside the server

Skip to first unread message

Karol Bisztyga

Aug 3, 2022, 11:27:19 AMAug 3
to grpc.io
I'm implementing a system in which the services communicate with each other via gRPC. I figured that I could just spawn a client inside of the server to talk to another server. Unfortunately, this solution failed for multiple simultaneous connections.
What I mean is, I have: clientservice1service2.
How it works:
- client makes a connection to service1 and sends data,
- service1 makes a connection to service2 and sends data,
- service1 waits until service2 finishes processing data,
- service2 terminates the connection with service1
- service1 terminates the connection with client

I'm using gRPC's reactors and the async API.
The problem: When I spawn 2 simultaneous connections from the client, the flow hangs in different places (it's not always the same place).

- Is the system properly designed (with the client spawned on the server)?
- Is there an example of something like that maybe somewhere?
- Has such a scenario (or similar) been considered by the authors of the gRPC?
- Are there any known issues/pitfalls when doing something like this? Maybe I missed setting something in the connection's config?
- Is it possible that the gRPC has not been designed to handle such scenarios? I'm having a hard time finding out whether the problem lies in my logic or in a library I use.

Thank you in advance!
Reply all
Reply to author
0 new messages