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

Include full exception when WatchQueueReader thread dies #2538

Merged
merged 4 commits into from
Jan 18, 2022

Conversation

ccutrer
Copy link
Contributor

@ccutrer ccutrer commented Oct 25, 2021

See #2537

Signed-off-by: Cody Cutrer cody@cutrer.us

@cweitkamp
Copy link
Contributor

Hi @ccutre,

One question: when logging this error message will a user be able to fix the cause? How?

@J-N-K
Copy link
Member

J-N-K commented Nov 1, 2021

No. The only possible way to fix is restarting openHAB.

@cweitkamp
Copy link
Contributor

The reason why I am asking - In case this exception leads to an unusable system e.g. because if a blocked rule engine we should give an advise how to solve the situation (e.g. by changing the logged message). This would be much better user experience.

@J-N-K
Copy link
Member

J-N-K commented Nov 1, 2021

IMO this should fix itself. The exception should not stop the WatchQueueReader. Maybe the try-catch-Block should be moved inside the for-loop, not around it.

@ccutrer
Copy link
Contributor Author

ccutrer commented Nov 1, 2021

+1, I'll move the catch inside the loop. I'm just completely in the dark as to what's causing the problem, so am a little afraid it's something that will constantly cause it to crash and restart. For me, the crash is happening every time OpenHAB starts.

Is there any documentation anywhere on how to put a locally compiled core bundle into an otherwise-running snapshot? That's the only place I can reproduce my error. I tried to replace the jar file that apt installs, but it didn't do anything, and if I put it in the addons folder karaf shows it sees the bundle, but it's inactive (presumably because some built-in one has already been loaded).

See openhab#2537

Signed-off-by: Cody Cutrer <cody@cutrer.us>
@ccutrer ccutrer force-pushed the watch_queue_reader_logging branch from 54f09ff to dded8cf Compare November 1, 2021 13:52
@ccutrer
Copy link
Contributor Author

ccutrer commented Nov 1, 2021

It looks like the build failed, but I'm not familiar enough with how it should look to know if it's related. There is a separate exception handling block to exit the thread gracefully on interrupt, but I could see it being a possibility that it just hangs when it tries to shut down now.

@jimtng
Copy link
Contributor

jimtng commented Nov 8, 2021

Note without this PR, the file watcher completely stopped when an exception occurred, and thus broke OpenHAB. Because this PR moved the try-catch inside the loop and not return out of the loop, the file watcher continues to work.

#2563 fixed the problem that was discovered thanks to the stacktrace reported by this PR.

@cweitkamp cweitkamp added the bug An unexpected problem or unintended behavior of the Core label Nov 8, 2021
Signed-off-by: Wouter Born <github@maindrain.net>
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.

Thanks for the fixes!

@wborn wborn merged commit 57ed7ef into openhab:main Jan 18, 2022
@wborn wborn added this to the 3.3 milestone Jan 18, 2022
@ccutrer ccutrer deleted the watch_queue_reader_logging branch October 4, 2022 19:35
splatch pushed a commit to ConnectorIO/copybara-hab-core that referenced this pull request Jul 12, 2023
See openhab#2537

Signed-off-by: Cody Cutrer <cody@cutrer.us>
GitOrigin-RevId: 57ed7ef
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.

5 participants