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
What operating system (Linux, Windows,...) and version?
Windows 10
Linux
What runtime / compiler are you using (e.g. python version or version of gcc)
VS 2022
gcc 11.2.0
What did you do?
I noticed that my gRPC client application crashes sometimes after main.
It was happened because gRPC doesn't deinitialize itself after stream operations even if all gRPC objects are destroyed.
To reproduce this situation I added to the helloworld sample async streaming operations and gRPC deinitialization waiting at the end. nikola-sh@3c7d8bc
If we run the server that sends 1 message and client
grpc_is_initialized is not part of the public API for gRPC C++. It is a gRPC Core API which is only meant to be used internally by the gRPC wrapped languages. At this point, it is considered something akin to an implementation detail.
@yashykt , grpc_is_initialized was used only to highlight the problem.
The problem is
I noticed that my gRPC client application crashes sometimes after main.
It was happened because gRPC doesn't deinitialize itself after stream operations even if all gRPC objects are destroyed.
C/C++ runtime deinitializes itself after main and alive GRPC threads crash.
What version of gRPC and what language are you using?
9d047f8
C++
What operating system (Linux, Windows,...) and version?
Windows 10
Linux
What runtime / compiler are you using (e.g. python version or version of gcc)
VS 2022
gcc 11.2.0
What did you do?
I noticed that my gRPC client application crashes sometimes after
main
.It was happened because gRPC doesn't deinitialize itself after stream operations even if all gRPC objects are destroyed.
To reproduce this situation I added to the
helloworld
sample async streaming operations and gRPC deinitialization waiting at the end.nikola-sh@3c7d8bc
If we run the server that sends 1 message and client
client reads message and is waiting in
while (grpc_is_initialized())
foreverBut if you run server that sends 0 message all will be fine.
client output:
In case of 10 messages problem reproduction is unstable, sometimes we see
Waiting GRPC shutdown
, but sometimes not.What did you expect to see?
I know that gRPC deinitialization can be asynchronous but I expect that waiting
while (grpc_is_initialized())
is finite and ends fast.The text was updated successfully, but these errors were encountered: