Exiting application with grpc in dll on windows

109 views
Skip to first unread message

Alexander

unread,
Dec 17, 2024, 10:17:47 AM12/17/24
to grpc.io
Hi!


Some questions arise here for me, would be really great if you could answer it: Is it supported that we load and initialize grpc after and in a dll, but do not unload it (so it is loaded until the end of the application). And is it safe that there won't be any "referenced" leaks or access violations on objects from grpc after other things got unloaded at the very end of the application? -> Because we don't have a way to say to grpc that we now want to end.

And what is the best way to handle this in general?

thx,
Alex

AJ Heller

unread,
Jan 2, 2025, 12:11:36 PM1/2/25
to grpc.io
Hi Alex,

This currently isn't well-supported. gRPC does some asynchronous work in the background even after all application-owned objects have been destroyed. Today, there is no way for an application to wait for gRPC to be shut down. Some work needs to be done internally to support a wait-for-shutdown API, and some of that work is being done today.

Your best way forward is to leave gRPC loaded until your process exits.

Best,
-aj

Alexander

unread,
Jan 7, 2025, 2:47:06 AM1/7/25
to grpc.io
Thx AJ for replying to my message!

So the "leave gRPC loaded until process exit" scenario is safe in every way? There are no possible side effects or operations that get cut off or access to any already freed resources?

What exactly do you mean by "some of that work is being done today"? Is anybody working on this at the moment? Can you give us more information?

thx,
Alex

Reply all
Reply to author
Forward
0 new messages