AglShellGrpcClient: Add wait_for_ready + deadline for grpc::Context 51/30651/1 master 19.90.0 trout/19.90.0 trout_19.90.0
authorMarius Vlad <marius.vlad@collabora.com>
Wed, 11 Dec 2024 11:30:56 +0000 (13:30 +0200)
committerMarius Vlad <marius.vlad@collabora.com>
Thu, 12 Dec 2024 12:22:17 +0000 (14:22 +0200)
commita3f206fcce874d4d98de9280c7f4ae67a57dc207
tree794c2f588203566ef4e29c66780d818a76df8cc7
parentfd77d8d38d899ca40d090344582f3ec816fd0591
AglShellGrpcClient: Add wait_for_ready + deadline for grpc::Context

It seems that gRPC channel might not be ready when issueing floating
request so add a wait_for_ready + deadline to make sure we don't send
the request until the channel is available. Initial testing (though we
might need more) shows that this fixes the issue.

The way this works is that the client (if started with wait_for_ready
set to true, passed in the AglShellGrpcClient constructor) will wait for
the channel to be ready and then issue a floating request. There's a
hidden deadline of 2 seconds in case that doesn't happen.

Bug-AGL: SPEC-5235
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: I40a5ad0dd760dc4559839ae7c302c1d6bc1ff973
app/AglShellGrpcClient.cpp
app/AglShellGrpcClient.h
app/main.cpp