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

Core threads in EnhancedQueueExecutor might timeout below core pool size even if allowCoreTimeOut is false #117

Open
dmlloyd opened this issue Aug 15, 2019 · 5 comments

Comments

@dmlloyd
Copy link
Contributor

dmlloyd commented Aug 15, 2019

I can see unexpected behavior in EnhancedQueueExecutor [1]. Even when I set allowsCoreThreadTimeOut to false, sometimes happens that pool size goes below core size by a few threads.

Test scenario:

  • create EnhancedQueueExecutor with coreSize=3, maxSize=6, allowsCoreThreadTimeOut=false, keepAliveTimeout=1000ms
  • submit 6 threads into executor and wait until all are running so maxSize is reached
  • allow all threads to finish and wait some time for threads to timeout

Expected result is that poolSize will be 3 as coreSize=3 but sometimes happens that poolSize is 2 or 1.

This might not be a bug as EnhancedQueueExecutor estimates its pool size and might allow to timeout more threads than coreSize. I'm creating this jira so it's explained for future reference.

[1] https://github.com/jbossas/jboss-threads/blob/2.3.3.Final/src/main/java/org/jboss/threads/EnhancedQueueExecutor.java

[2] https://issues.jboss.org/browse/EAP7-488

This issue was imported from JIRA. The original issue is JBTHR-78. It was originally reported by @mnovak1.

@dmlloyd
Copy link
Contributor Author

dmlloyd commented Aug 19, 2019

It looks like the same as JBTHR-49. But JBTHR-49 was fixed in jboss-threads version 2.3.1.Final, 2.4.0.Final, and wildfly-core currently has jboss-threads version 2.3.3.Final, but still sees this problem.

This comment was imported from JIRA. It was originally authored by @chengfang.

@dmlloyd
Copy link
Contributor Author

dmlloyd commented Aug 19, 2019

Should this be in JBTHR?

This comment was imported from JIRA. It was originally authored by @bstansberry.

@dmlloyd
Copy link
Contributor Author

dmlloyd commented Aug 20, 2019

Yes, JBTHR-49 is fixed in 2.3.3.Final. This will be something else.

This comment was imported from JIRA. It was originally authored by @mnovak1.

@sarthaksarthak9
Copy link

hey, i would to like to solve it .. please assign this to me

@dmlloyd
Copy link
Contributor Author

dmlloyd commented Feb 13, 2023

You may send in a PR even if an issue isn't assigned. I do not usually use the assignment function.

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

No branches or pull requests

2 participants