-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[cbus] fix exception from threadpool at startup #11846
Conversation
…ying threadpool implementation Signed-off-by: John Harvey <john.p.harvey@btinternet.com>
This pull request has been mentioned on openHAB Community. There might be relevant details there: |
...org.openhab.binding.cbus/src/main/java/org/openhab/binding/cbus/internal/CBusThreadPool.java
Outdated
Show resolved
Hide resolved
@jpharvey : no feedback to review comment? |
@lolodomo I dont understand your question. I added a not that the suggestion in the review doesn't work because the method suggested is private and can't be called. |
You are right, I missed that. |
So we can forget your comment @jlaur , right? |
Yes, sorry for late reply, a router firmware upgrade didn't go smooth, so had to use the night for fixing my network. Currently I don't have any comments, didn't have time to go back to it. Something was itching me as the way the binding was broken could happen again, so was looking for a way to make it more robust. Anyway, please disregard my comment. |
|
||
public CBusThreadPoolExecutor(@Nullable String poolName) { | ||
threadPool = (ThreadPoolExecutor) ThreadPoolManager.getPool("binding.cbus-" + poolName); | ||
threadPool = (ExecutorService) ThreadPoolManager.getPool("binding.cbus-" + poolName); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think casting is needed as getPool
returns ExecutorService
:
https://www.openhab.org/javadoc/latest/org/openhab/core/common/threadpoolmanager#getPool(java.lang.String)
?
Signed-off-by: John Harvey <john.p.harvey@btinternet.com>
@jlaur Thank you for the review. I have remove the cast from that line now, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTN
* update to use executorservice to fix crash caused by change in underlying threadpool implementation * Remove explicit cast Signed-off-by: John Harvey <john.p.harvey@btinternet.com> Signed-off-by: Michael Schmidt <mi.schmidt.83@gmail.com>
* update to use executorservice to fix crash caused by change in underlying threadpool implementation * Remove explicit cast Signed-off-by: John Harvey <john.p.harvey@btinternet.com>
* update to use executorservice to fix crash caused by change in underlying threadpool implementation * Remove explicit cast Signed-off-by: John Harvey <john.p.harvey@btinternet.com>
* update to use executorservice to fix crash caused by change in underlying threadpool implementation * Remove explicit cast Signed-off-by: John Harvey <john.p.harvey@btinternet.com> Signed-off-by: Nick Waterton <n.waterton@outlook.com>
* update to use executorservice to fix crash caused by change in underlying threadpool implementation * Remove explicit cast Signed-off-by: John Harvey <john.p.harvey@btinternet.com>
* update to use executorservice to fix crash caused by change in underlying threadpool implementation * Remove explicit cast Signed-off-by: John Harvey <john.p.harvey@btinternet.com> Signed-off-by: Andras Uhrin <andras.uhrin@gmail.com>
Fixes #11845
After changes in 3.2 to the ThreadPool implementation the return from getpool can no longer be cast to ThreadPoolExecutor.
Changing this to ExecutorService fixes this problem and the binding works again.