grpc icon indicating copy to clipboard operation
grpc copied to clipboard

[core] checking the status of thread creation

Open chansen3 opened this issue 1 year ago • 1 comments

It is possible for allocation of a system resource to fail. While the Thread abstraction in the core allows for a 'success' parameter, it is optional and not generally checked where used. This can lead to degenerate behavior which is hard to diagnose. In particular, the Executors assign Closures to their queues regardless of whether the thread handling to queue is actually running, leading those async requests to hang.

This change makes the 'success' parameter required and tries to make the correct decision on how to proceed in the code where those Threads are started. For the Executor, we will attempt to carry on with the number of threads we were able to create. In other areas, we assert, assuming that whatever function is being performed by the allocated thread is critical to the overall function of the library.

For the tests, we ignore the value of 'success' as we assume the tests will fail if thread creation failed. This is no different than the existing behavior.

chansen3 avatar May 02 '24 16:05 chansen3

Resubmitting original PR: https://github.com/grpc/grpc/pull/33286

chansen3 avatar May 02 '24 16:05 chansen3

More than 30 days have passed since label "disposition/requires reporter action" was added. Closing this issue. Please feel free to re-open/create a new issue if this is still relevant.

grpc-bot avatar Jul 05 '24 00:07 grpc-bot