Skip to content
This repository was archived by the owner on Dec 9, 2025. It is now read-only.

Restructure MQTT config distribution#234

Merged
hikinggrass merged 11 commits intomainfrom
feature/restructure-mqtt-config
Jan 31, 2025
Merged

Restructure MQTT config distribution#234
hikinggrass merged 11 commits intomainfrom
feature/restructure-mqtt-config

Conversation

@hikinggrass
Copy link
Member

  • publish manifests individually on retained topics instead in one big blob
  • change module/impl config entry format to include its type, this removes the need for the whole config schema just to determine the type
  • reorder the config handler before the ready handler in manager to reflect the order of operations taken during initialization of a module
  • smaller optimizations

The same functionality can be achieved without first including the main config in the serialized config and then deleting it...

Signed-off-by: Kai-Uwe Hermann <kai-uwe.hermann@pionix.de>

# Conflicts:
#	src/manager.cpp

Signed-off-by: Kai-Uwe Hermann <kai-uwe.hermann@pionix.de>
Skip storing it in a temporary variable

Signed-off-by: Kai-Uwe Hermann <kai-uwe.hermann@pionix.de>
…etain

Previously this was sent to every module individually which isn't necessary

Signed-off-by: Kai-Uwe Hermann <kai-uwe.hermann@pionix.de>
Add type to parsed_config_map and remove config entry from manifest sent via MQTT

Signed-off-by: Kai-Uwe Hermann <kai-uwe.hermann@pionix.de>
Signed-off-by: Kai-Uwe Hermann <kai-uwe.hermann@pionix.de>
…e is required

Signed-off-by: Kai-Uwe Hermann <kai-uwe.hermann@pionix.de>
Signed-off-by: Kai-Uwe Hermann <kai-uwe.hermann@pionix.de>
@hikinggrass hikinggrass requested a review from a-w50 January 8, 2025 11:44
Signed-off-by: Kai-Uwe Hermann <kai-uwe.hermann@pionix.de>
…qtt-config

# Conflicts:
#	src/manager.cpp

Signed-off-by: Kai-Uwe Hermann <kai-uwe.hermann@pionix.de>
@corneliusclaussen
Copy link
Contributor

retained topics: Could this lead to potential left-over problems of previous EVerest runs? In the default mosquitto config it is even stored permanently surviving reboots. Is it ensured that there can't be race conditions where e.g. one module subscribes to mqtt before the manager publishes the new config?

@hikinggrass
Copy link
Member Author

hikinggrass commented Jan 20, 2025

retained topics: Could this lead to potential left-over problems of previous EVerest runs? In the default mosquitto config it is even stored permanently surviving reboots.

Yes, and this is partially addressed with #233 (at least for successful starts, there is be more cleanup needed in cases the manager exits early, I'll address this over there). However the retained topics behavior is already in v0.19 and v0.19.1, so #233 is already an improvement as is

Is it ensured that there can't be race conditions where e.g. one module subscribes to mqtt before the manager publishes the new config?

For configs this should not be an issue since a module explicitly requests a config from the manager and this doesn't involve retained topics. For manifest/interfaces/etc. there may be scenarios where this is a problem. It seems pretty stable thought (eg. I run the ocpp-tests of everest-core in parallel with all cores of my machine reliably all the time) but I will investigate this a bit further

@corneliusclaussen
Copy link
Contributor

just a random thought: would it make sense to clear those topics as a last will from the manager?

@hikinggrass
Copy link
Member Author

just a random thought: would it make sense to clear those topics as a last will from the manager?

yes, sounds like a good idea. I plan on opening a PR with some signal handling for the manager that could then trigger this as well. During normal operation #233 will clean them up after every module is ready

@hikinggrass hikinggrass requested review from corneliusclaussen and removed request for a-w50 January 29, 2025 13:10
…qtt-config

Signed-off-by: Kai-Uwe Hermann <kai-uwe.hermann@pionix.de>
@hikinggrass hikinggrass merged commit 26e31ac into main Jan 31, 2025
5 checks passed
@hikinggrass hikinggrass deleted the feature/restructure-mqtt-config branch January 31, 2025 10:29
hikinggrass added a commit that referenced this pull request Feb 6, 2025
#234 changed the format of the config passed to a module which wasn't properly implemented in everestpy

Signed-off-by: Kai-Uwe Hermann <kai-uwe.hermann@pionix.de>
hikinggrass added a commit that referenced this pull request Feb 6, 2025
* Fix config parsing for everestpy

#234 changed the format of the config passed to a module which wasn't properly implemented in everestpy

* refactor duplicate code in everestjs and everestpy

* Bump everest version to 0.20.2

---------

Signed-off-by: Kai-Uwe Hermann <kai-uwe.hermann@pionix.de>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants