-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
What are implications of small queue for Hystrix thread pool? #933
Comments
Here's a comment from the JDK implementation of ThreadPoolExecutor: /* |
The above comment implies that if |
Just saw the unit test: In this case, we set up a single-threaded threadpool, with a queue sized at 10 and a rejection threshold of 1. We put a latent Runnable into the queue (outside of any Hystrix work). Then we submit work to the pool via a Hystrix command execution. The task gets rejected, even though the threadpool has a thread available |
After more research, the way this works is that all submitted work first goes to the queue in front of the threadpool, and then the threadpool picks it up at some later point. If using a SynchronousQueue, this happens synchronously, otherwise it happens asynchronously. This implies that an infinitely big threadpool with a finite queue will still reject some tasks, if they get rejected upon insertion to the queue. |
Question raised in https://groups.google.com/forum/#!topic/hystrixoss/XgAuwe2RxS8.
I added some unit tests in #911 to check. These have failed in CI fairly frequently, so I'd like to understand this scenario more thoroughly.
The text was updated successfully, but these errors were encountered: