Skip to content
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

Javanica threadpool properties per class are applied to all thread pools #926

Closed
john-roj opened this issue Oct 9, 2015 · 7 comments
Closed

Comments

@john-roj
Copy link

john-roj commented Oct 9, 2015

On our project we have 2 classes Annotated with @HystrixCommand

public class SomeService {

     @HystrixCommand(
        ignoreExceptions = { NonSevereClientException.class },
        commandProperties = {
            @HystrixProperty(name = "execution.isolation.thread.timeoutInMilliseconds", value = 5000)
        },
        threadPoolProperties = {
            @HystrixProperty(name = "coreSize", value = 75,
            @HystrixProperty(name = "maxQueueSize", value = 5)
        })
        public Response getAll(Long someParam) {}  ...

The other class uses defaults for thread pool properties:

public class SomeOtherService {

     @HystrixCommand(
        ignoreExceptions = { NonSevereClientException.class },
        commandProperties = {
            @HystrixProperty(name = "execution.isolation.thread.timeoutInMilliseconds", value = 5000)
        }
        public Response getStuff() {}  ...

However when we check the Dashboard both thread pools have poolSize set to 75.

screen shot 2015-10-09 at 11 23 37 am

Is this expected?

@dmgcodevil
Copy link
Contributor

Hi,
I don't think that it's correct behavior, could you try to specify specific thread pool name using threadPoolKey property of HystrixCommand annotation and see what happen ?

@HystrixCommand(threadPoolKey="thp1")
public Response getAll(Long someParam) {} 

@HystrixCommand(threadPoolKey="thp2")
public Response getStuff() {} 

Thanks

@john-roj
Copy link
Author

john-roj commented Oct 9, 2015

Well adding the threadPoolKey seems to have worked... I am wondering if it is indeed a bug and this is a workaround.

Thanks

@dmgcodevil
Copy link
Contributor

it looks like a bug, currently I'm working on #907 bug and at the same time will check this one

@dmgcodevil
Copy link
Contributor

Actually we have the tests to check command properties including threadPoolKey and it works well: test, I've added more tests but failed to reproduce the issue.
@john-roj87 what javanica version are you using, also could you write a test that reproduces the issue ?

@dmgcodevil
Copy link
Contributor

Ok, I found root cause of the issue, actually it's the same for #782 and should be fixed altogether

@dmgcodevil
Copy link
Contributor

@mattrjacobs hi, you can close it

@lingyejun
Copy link

you can set tomcat's max-thread to solve the question.
e.g server.tomcat.max-threads=200

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants