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

Fix WatchQueueReader cancelling jobs too early #2745

Merged
merged 3 commits into from
Feb 12, 2022

Conversation

J-N-K
Copy link
Member

@J-N-K J-N-K commented Feb 10, 2022

Related to #2727

While investigating the issue above I found that the new version of the WatchQueueReader erroneously cancelled the job when removing it from the stored jobs.

This is done on two occasions:

  • If a jobs is stored and we try to replace it. In this case cancellation is correct.
  • If the job executes. Cancelling the job here is wrong. It is not noticed by the tests because it interrupts the job, which is not checked for our short-running jobs. In the issue above the job is checking if the thread is interrupted and therefore fails.

@wborn I also moved the tests to the org.openhab.core package and added the JavaTest as you suggested.

Signed-off-by: Jan N. Klug github@klug.nrw

Signed-off-by: Jan N. Klug <github@klug.nrw>
Signed-off-by: Jan N. Klug <github@klug.nrw>
Copy link
Member

@wborn wborn left a comment

Choose a reason for hiding this comment

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

It looks OK to me! 👍 But I'd also then use .equals instead of == on line 255:

@wborn wborn changed the title fix WatchQueueReader cancelling jobs too early Fix WatchQueueReader cancelling jobs too early Feb 12, 2022
Signed-off-by: Jan N. Klug <github@klug.nrw>
@J-N-K
Copy link
Member Author

J-N-K commented Feb 12, 2022

Done.

@wborn wborn merged commit c0b033b into openhab:main Feb 12, 2022
@wborn wborn added this to the 3.3 milestone Feb 12, 2022
@J-N-K J-N-K deleted the bug-fix-watchqueuereader-cancels-job branch February 12, 2022 09:11
@wborn wborn added the bug An unexpected problem or unintended behavior of the Core label Feb 12, 2022
splatch pushed a commit to ConnectorIO/copybara-hab-core that referenced this pull request Jul 12, 2023
Signed-off-by: Jan N. Klug <github@klug.nrw>
GitOrigin-RevId: c0b033b
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 the Core
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants