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
I was trying to implement a cascade gRPC (say gRPC service A and gRPC service B), where service A launches B and immediately returns, and B is a server-streaming call.
My problem is that the service B is not successfully executed. Not sure if it was cancelled silently.
Inside service A (gRPC unary call), I implemented like below:
// inside service Aval threadLocalContext =Context.current().fork()
threadLocalContext.run {
CoroutineScope(GrpcContextElement(threadLocalContext)).launch{
// intends to call service B here but not successful. Seems nothing happens.val result = serviceBStub.invokeServerStreamingService(serviceBRequest)
}
}
// service A exits
But it turns out that the service B server streaming call was never invoked. If I change B to a unary call it can successfully execute. So it seems that thread local is propagated, but I am not sure if this is the case in server streaming call situation.
Or if the server streaming call was cancelled? I did not see any exceptions being thrown.
Can someone tell me what went wrong and how to make it behave as intended? Thanks!
This discussion was converted from issue #476 on December 12, 2023 15:59.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I was trying to implement a cascade gRPC (say gRPC service A and gRPC service B), where service A launches B and immediately returns, and B is a server-streaming call.
My problem is that the service B is not successfully executed. Not sure if it was cancelled silently.
Inside service A (gRPC unary call), I implemented like below:
But it turns out that the service B server streaming call was never invoked. If I change B to a unary call it can successfully execute. So it seems that thread local is propagated, but I am not sure if this is the case in server streaming call situation.
Or if the server streaming call was cancelled? I did not see any exceptions being thrown.
Can someone tell me what went wrong and how to make it behave as intended? Thanks!
Beta Was this translation helpful? Give feedback.
All reactions