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
This code path does not make sense to me: It first reduces the poller count by one and then checks } else if (num_pollers_ > 0) {. This way it will always ignore the own thread.
As far as I understand, the resource exhausted case should not occur when I have configured a thread limit of 1 and I have 1 thread worker (as expected). I'd rather expect the condition to be } else if ((num_pollers_+1) > 0) { since we already decremented the num_pollers and should not ignore our own thread.
What did you expect to see?
Start a grpc callback server with SetResourceQuota(ResourceQuota().SetMaxThreads(1)); should work even under load.
What did you see instead?
grpc server terminates.
The text was updated successfully, but these errors were encountered:
Please provide a minimum repro in the form of a runnable example in a github repo, or a gist. I'm not sure what you mean by termination here, and the ThreadManager is used for sync servers.
Termination as in: The grpc server will shut down because it tries to spawn an additional thread but detects that this would violate the thread resource quota of one thread.
Did you have a look at the code that I referenced in thread_manager.cc ?
The MainWorkLoop is quite a simple function and I believe I already described coherently what's going wrong in that function.
What version of gRPC and what language are you using?
1.62.1
What operating system (Linux, Windows,...) and version?
Linux
What runtime / compiler are you using (e.g. python version or version of gcc)
clang 17
What did you do?
Start a grpc callback server with
SetResourceQuota(ResourceQuota().SetMaxThreads(1));
Put some load on the server so we hit the following code-path:
grpc/src/cpp/thread_manager/thread_manager.cc
Line 204 in 84ee28e
This code path does not make sense to me: It first reduces the poller count by one and then checks
} else if (num_pollers_ > 0) {
. This way it will always ignore the own thread.As far as I understand, the resource exhausted case should not occur when I have configured a thread limit of 1 and I have 1 thread worker (as expected). I'd rather expect the condition to be
} else if ((num_pollers_+1) > 0) {
since we already decremented thenum_pollers
and should not ignore our own thread.What did you expect to see?
Start a grpc callback server with
SetResourceQuota(ResourceQuota().SetMaxThreads(1));
should work even under load.What did you see instead?
grpc server terminates.
The text was updated successfully, but these errors were encountered: