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
Task rejected from pool even when queue is configured #1428
Comments
The way it actually works ( Still, in your case, I would expect that tasks would end up in the queue. Do you have a unit test that reproduces this behavior? |
Thanks for the clarification. Unfortunately I am not able to reproduce locally. I can't even reproduce it in our test environment. The exception only occurs in production. Will continue the investigation. At least I know now that I haven't misunderstood how it is supposed to work. |
Hi, I am facing a similar issue, using javanica 1.5.2. I set the maxQueueSize and queueSizeRejectionThreshold for the particular thread pool (through the thread pool key, instead of default value provided in this ticket example), and I am getting a similar exception. I can't reproduce it locally either, but in production is happening some how. The error looks as if the maxQueueSize were set to a negative value and a sync queue were being used instead, but checking config in prod (we are using spring boot with spring cloud configs) both maxQueueSize and queueSizeRejectionThreshold seem to be properly set, and one seems to be taking effect (I see rejectionThreshold in exposed metrics, and hystrix stream) but the other not (the queue size, as the error says queued tasks = 0). Any clues what might be happening, or where could I check to trace this issue? Any way you may come up with for checking the actual value that the instance of the pool is using, or type of queue, to verify if the config I am seeing is properly loaded into the thread pool instance and no side logic, or race condition in initialization may be happening? Regards. |
The Hystrix configuration stream reports all configuration. This is one way to inspect what the actual config is. |
Thank you, will try including that in the application and check reported values. |
The issue I was facing was effectively an initialization issue, and in particular with spring-boot + spring-cloud-netflix (using Brixton.SR7) and was mainly affecting the queue size configuration due to it's static nature (other properties can be changed on the fly). I know is outside of the scope of hystrix but I will put some details just in case someone gets same issue and finds this hystrix issue: In my case some traffic going into spring-boot application through kafka (no web traffic, and kafka consumer initialized in a configuration class) was causing hystrix command (using Regards, and thank you again for the information about the configuration stream :-). |
Glad you got it solved - thanks for reporting back the details |
@rabelenda I ran into a similar issue (spring-cloud/spring-cloud-netflix#1950). I'm curious how did you conclude that the Hystrix command was created with default values, because you said Hystrix metrics stream was reporting the correct values. |
Debugged application and analyzed Spring beans initialization debug logs. In the scenario it was not initializing properly, the ArchaiusAutoconfig bean was being created after the bean that used the hystrix command. Metrics were of no use since they didn't report queue size but rejection threshold. The links Matt shared should have provided (but I didn't try) further evidence of queue size initialized with defaults instead of configured sizes. Regards. |
This is a discussion best had in the spring-cloud-netflix repo but for completeness sake, I'll continue the conversation on this thread. @rabelenda Thanks for your response. It's not clear to me how you're creating your Edit: |
In my case even the @HystrixCommand annotated method was invoked before the ArchaiusAutoconfig. |
@rabelenda I can't reproduce the problem you're describing. Is it possible for you to create a sample app that demonstrates this issue? Note that I'm not challenging the fact that Edit: |
I am also facing similar issue, not able to reproduce the issue. I am using spring cloud dependency as Hoxton.RC1 and hystrix-core.1.5.18. hystrix: I still get exception for default thread pool configuration. It says pool size 10, where as in my configuration coreSize: 200 Is there a way i can see these configuration once my service started in production? |
@mattrjacobs @rabelenda can you please help me on my question? |
Even in my case, i ran into similar issue (hysyrix-core-1.5.18). Task java.util.concurrent.FutureTask@59c4b527 rejected from java.util.concurrent.ThreadPoolExecutor@51cd4319[Running, pool size = 10, active threads = 10, queued tasks = 0, completed tasks = 12759] Any suggestions on this issue? |
Hello,
I have configured a thread pool like this:
As long as there is a thread available in the pool I want the task to be performed and if there are no threads available I want the task to be added to a queue and be performed when a thread becomes available.
When performing jobs with more than 10 task I keep getting the following exception:
Shouldn't the task be put on the queue? According to the exception queued tasks is 0. I would understand this behavior if queued tasks were 100.
The text was updated successfully, but these errors were encountered: