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 StackOverflowError in SemanticsMetadataProvider #3748

Merged
merged 2 commits into from
Aug 12, 2023

Conversation

J-N-K
Copy link
Member

@J-N-K J-N-K commented Aug 11, 2023

In case of cyclic/recursive membership of groups (i.e. a group has itself or a child as parent) the recursive processing of the items leads to an StackOverflowError (reported in the forum and the german Facebook group). Also this is clearly a configuration error it should not result in the bundle not starting.

In case of cyclic/recursive membership of groups (i.e. a group has itself or a child as parent) the recursive processing of the items leads to an `StackOverflowError` (reported in the forum and the german Facebook group). Also this is clearly a configuration error it should not result in the bundle not starting.

Signed-off-by: Jan N. Klug <[email protected]>
@J-N-K J-N-K added the bug An unexpected problem or unintended behavior of the Core label Aug 11, 2023
@J-N-K J-N-K requested a review from a team as a code owner August 11, 2023 16:47
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.

The fix looks good to me. 👍 Would it also be possible to add a unit test for this? Did you also consider using the warn loglevel? It is quite severe but I don't know if it is error level severe because the system can handle it.

Signed-off-by: Jan N. Klug <[email protected]>
@J-N-K
Copy link
Member Author

J-N-K commented Aug 12, 2023

I chose the same log level that is used here:

LOGGER.error(
"Recursive group membership found: {} is both, a direct or indirect parent and a child of {}.",
member.getName(), groupItem.getName());

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.

Thank you for also adding the tests and log level explanation. 👍

@wborn wborn merged commit caf13da into openhab:main Aug 12, 2023
2 checks passed
@wborn wborn added this to the 4.1 milestone Aug 12, 2023
@J-N-K J-N-K deleted the fix-soe-semanticmetadataprovider branch August 12, 2023 09:50
@openhab-bot
Copy link
Collaborator

This pull request has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/problem-after-upgrade/148149/14

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.

3 participants