-
Notifications
You must be signed in to change notification settings - Fork 55
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
feat: enable mosquitto persistence by default #3232
base: main
Are you sure you want to change the base?
feat: enable mosquitto persistence by default #3232
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files📢 Thoughts on this report? Let us know! |
Robot Results
|
Though I'm just reviewing one aspect regarding the If non is defined it will choose the current location, but this may be problematic as I don't see the mosquitto service defining the default working directory, which means the current working directory maybe somewhere that the
@albinsuresh @didier-wenzek Any thoughts on this? Should we try to set the default path ourselves? Or even consider creating our own mosquitto configuration package? |
// Enable persistence as thin-edge.io heavily relies on retained messages and | ||
// if mosquitto persistence is not configured, then it can lead to unexpected behavior | ||
writeln!(writer, "persistence true")?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Beware that the file /etc/tedge/mosquitto-conf/tedge-mosquitto.conf
is populated only if there is at least one cloud connected.
I would consider to improve the tedge refresh-bridges
command to populate this file even if there is no bridge configured. I.e. moving these 2 lines before that one
Can we not write a new config file with these persistence settings into the |
Ok, I'm going to move the state of this PR to draft until we work out a way forward. |
Proposed changes
Open Questions
persistence true
or not and configured the path (with the correct permissions set).Enable persistence as thin-edge.io heavily relies on retained messages and if mosquitto persistence is not configured, then it can lead to unexpected behavior.
For example (assuming mosquitto persistence is not enabled), if the tedge-agent has already started, and then the user runs
tedge connect c8y
, then any previously retained message published by tedge-agent will not be republished, and the tedge-mapper-c8y will not know of the previously published retained messages...this leads to supported operations not being sent to the cloud.Given the impact of not having mosquitto persistence configured, it should not be left up to the user to configure it.
Types of changes
Paste Link to the issue
Checklist
cargo fmt
as mentioned in CODING_GUIDELINEScargo clippy
as mentioned in CODING_GUIDELINESFurther comments