Concurrent requests on the server

38 views
Skip to first unread message

Sumukh Shivaprakash

unread,
Mar 23, 2020, 1:24:05 PM3/23/20
to grpc.io
I have a newbie question on grpc server handlers in c++. 

The greeter example shows how the server requests for an API by registering a "RequestSayHello()" and on receiving a request from a client, creates a new object that registers another "RequestSayHello()" for subsequent requests, after which it starts processing the first one.

My question is:
In the event of a delay (e.g. context switch) before registering the new "RequestSayHello()", what is the behavior if the client sends another request message? Is it rejected by the server because there are no registered handlers? 

Mark D. Roth

unread,
Mar 25, 2020, 1:49:59 PM3/25/20
to Sumukh Shivaprakash, grpc.io
No, the incoming request will be queued by the server.

--
You received this message because you are subscribed to the Google Groups "grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email to grpc-io+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/f934fa06-2d68-40ea-ba74-affb1f6d6228%40googlegroups.com.


--
Mark D. Roth <ro...@google.com>
Software Engineer
Google, Inc.

Sumukh Shivaprakash

unread,
Mar 25, 2020, 4:05:29 PM3/25/20
to grpc.io
Thanks Mark.
As a follow up, how does the server differentiate between this case and the scenario when the upper layer doesn't register again?


On Wednesday, March 25, 2020 at 10:49:59 AM UTC-7, Mark D. Roth wrote:
No, the incoming request will be queued by the server.

On Mon, Mar 23, 2020 at 10:24 AM Sumukh Shivaprakash <sumuk...@gmail.com> wrote:
I have a newbie question on grpc server handlers in c++. 

The greeter example shows how the server requests for an API by registering a "RequestSayHello()" and on receiving a request from a client, creates a new object that registers another "RequestSayHello()" for subsequent requests, after which it starts processing the first one.

My question is:
In the event of a delay (e.g. context switch) before registering the new "RequestSayHello()", what is the behavior if the client sends another request message? Is it rejected by the server because there are no registered handlers? 

--
You received this message because you are subscribed to the Google Groups "grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email to grp...@googlegroups.com.

Mark D. Roth

unread,
Mar 25, 2020, 4:09:28 PM3/25/20
to Sumukh Shivaprakash, grpc.io
If the server never requests a new call, I believe that HTTP/2 flow control will eventually kick in, at which point the client(s) will stop being able to start new calls.

To unsubscribe from this group and stop receiving emails from it, send an email to grpc-io+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/dedf886b-d606-4b84-bc58-cbe83dfaa1dc%40googlegroups.com.

Sumukh Shivaprakash

unread,
Mar 25, 2020, 7:09:59 PM3/25/20
to grpc.io
Makes sense - Thank you!


On Wednesday, March 25, 2020 at 1:09:28 PM UTC-7, Mark D. Roth wrote:
If the server never requests a new call, I believe that HTTP/2 flow control will eventually kick in, at which point the client(s) will stop being able to start new calls.

On Wed, Mar 25, 2020 at 1:05 PM Sumukh Shivaprakash <sumuk...@gmail.com> wrote:
Thanks Mark.
As a follow up, how does the server differentiate between this case and the scenario when the upper layer doesn't register again?

On Wednesday, March 25, 2020 at 10:49:59 AM UTC-7, Mark D. Roth wrote:
No, the incoming request will be queued by the server.

On Mon, Mar 23, 2020 at 10:24 AM Sumukh Shivaprakash <sumuk...@gmail.com> wrote:
I have a newbie question on grpc server handlers in c++. 

The greeter example shows how the server requests for an API by registering a "RequestSayHello()" and on receiving a request from a client, creates a new object that registers another "RequestSayHello()" for subsequent requests, after which it starts processing the first one.

My question is:
In the event of a delay (e.g. context switch) before registering the new "RequestSayHello()", what is the behavior if the client sends another request message? Is it rejected by the server because there are no registered handlers? 

--
You received this message because you are subscribed to the Google Groups "grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email to grp...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/f934fa06-2d68-40ea-ba74-affb1f6d6228%40googlegroups.com.


--
Mark D. Roth <ro...@google.com>
Software Engineer
Google, Inc.

--
You received this message because you are subscribed to the Google Groups "grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email to grp...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages