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

[mqtt.homeassistant] Fix unbounded growth of config for device_trigger #17894

Merged

Conversation

ccutrer
Copy link
Contributor

@ccutrer ccutrer commented Dec 12, 2024

Because of how it shares a channel, whenever openHAB was rebooted and it would first restore the device trigger components from the channel configuration, and then from the MQTT message, it didn't identify it as the same component as before, and so would merge into another instance of itself. My Things.json is normally 13MB, and had grown to 545MB, and my openHAB was constantly having memory issues! So now just make sure we only keep unique information, which will automatically clean up anyone in a bad state.

Because of how it shares a channel, whenever openHAB was rebooted and it
would first restore the device trigger components from the channel configuration,
and then from the MQTT message, it didn't identify it as the same component
as before, and so would merge into another instance of itself. My Things.json
is normally 13MB, and had grown to 545MB, and my openHAB was constantly having
memory issues! So now just make sure we only keep unique information, which
will automatically clean up anyone in a bad state.

Signed-off-by: Cody Cutrer <cody@cutrer.us>
@ccutrer ccutrer requested a review from antroids as a code owner December 12, 2024 20:07
@ccutrer ccutrer added regression Regression that happened during the development of a release. Not shown on final release notes. bug An unexpected problem or unintended behavior of an add-on labels Dec 12, 2024
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 c6f2fca into openhab:main Dec 13, 2024
4 of 5 checks passed
@jlaur jlaur added this to the 4.3 milestone Dec 13, 2024
@ccutrer ccutrer deleted the mqtt-homeassistant-unbounded-device_trigger branch December 13, 2024 15:52
matchews pushed a commit to matchews/openhab-addons that referenced this pull request Dec 16, 2024
openhab#17894)

Because of how it shares a channel, whenever openHAB was rebooted and it
would first restore the device trigger components from the channel configuration,
and then from the MQTT message, it didn't identify it as the same component
as before, and so would merge into another instance of itself. My Things.json
is normally 13MB, and had grown to 545MB, and my openHAB was constantly having
memory issues! So now just make sure we only keep unique information, which
will automatically clean up anyone in a bad state.

Signed-off-by: Cody Cutrer <cody@cutrer.us>
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 regression Regression that happened during the development of a release. Not shown on final release notes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants