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

[PJLink] Fix RejectedExecutionException on discovery #16119

Merged
merged 1 commit into from Dec 28, 2023

Conversation

nils
Copy link
Contributor

@nils nils commented Dec 26, 2023

This is an issue if the user cancels/restarts discovery scans, new tasks were added to the shutdown threadpool.

  • With this PR, a new threadpool will be created on the next scan in getExecutorService().
  • Without this PR, java.util.concurrent.RejectedExecutionExceptions would happen from the second scan.

@nils nils force-pushed the pjlink-fix-repeated-scan branch 3 times, most recently from 06af7a9 to 92544de Compare December 26, 2023 16:27
@nils nils changed the title [PJLink] restart threadpool if it was shutdown before [PJLink] forget threadpool after it was shutdown Dec 26, 2023
This is an issue if the user cancels/restarts discovery scans, new tasks were added to the shutdown threadpool.
With this PR, a new threadpool will be created on the next scan in getExecutorService().

Signed-off-by: Nils Schnabel <github@to.nilsschnabel.de>
@nils nils marked this pull request as ready for review December 26, 2023 16:36
Copy link
Contributor

@jlaur jlaur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix!

@jlaur jlaur merged commit b5c2423 into openhab:main Dec 28, 2023
3 checks passed
@jlaur jlaur added this to the 4.2 milestone Dec 28, 2023
@jlaur jlaur added the bug An unexpected problem or unintended behavior of an add-on label Dec 28, 2023
@jlaur jlaur changed the title [PJLink] forget threadpool after it was shutdown [PJLink] Fix RejectedExecutionException on discovery Dec 28, 2023
jlaur pushed a commit that referenced this pull request Dec 28, 2023
This is an issue if the user cancels/restarts discovery scans, new tasks were added to the shutdown threadpool.
With this PR, a new threadpool will be created on the next scan in getExecutorService().

Signed-off-by: Nils Schnabel <github@to.nilsschnabel.de>
@jlaur jlaur added the patch A PR that has been cherry-picked to a patch release branch label Dec 28, 2023
austvik pushed a commit to austvik/openhab-addons that referenced this pull request Mar 27, 2024
This is an issue if the user cancels/restarts discovery scans, new tasks were added to the shutdown threadpool.
With this PR, a new threadpool will be created on the next scan in getExecutorService().

Signed-off-by: Nils Schnabel <github@to.nilsschnabel.de>
Signed-off-by: Jørgen Austvik <jaustvik@acm.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An unexpected problem or unintended behavior of an add-on patch A PR that has been cherry-picked to a patch release branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants