fledge-iot / fledge-service-dispatcher

Dispatcher service is responsible for dispatching control messages between Fledge services.
0 stars 0 forks source link

Control pipelines: Cannot update filter configuration #61

Closed FlorentP42 closed 7 months ago

FlorentP42 commented 10 months ago

Describe the bug When a control pipeline with a filter is created, changing the configuration of said filter does not work (the new configuration appears in the GUI, but is not actually used by the filter).

To Reproduce Steps to reproduce the behavior:

  1. Create a north service.
  2. Create a south service.
  3. Create a filter "FilterA" with a string parameter "config" (default value "DEFAULT") that prints the content of "config" every time a reading enters the filter and forwards the reading unchanged. Also add a log in the plugin_reconfigure() method.
  4. Create a control pipeline between those services with FilterA in the list of filters.
  5. Update the "config" parameter of FilterA in the control pipeline options with the value "UPDATED".
  6. Notice that the log from plugin_reconfigure() never appears after step 5 was executed.
  7. Call a command from the north plugin so that FilterA processes it.
  8. Notice the FilterA still prints "DEFAULT" and not "UPDATED".

Expected behavior Updating the configuration of a filter part of a control pipeline is actually taken into account by said filter.

Additional context Note that configuring FilterA through scripted API calls right after it is created and before it is provided to the control pipeline allows to give it a custom configuration once. Yet it is still impossible to update that configuration after the pipeline creation.

FlorentP42 commented 10 months ago

Something seems to have changed about this issue in Fledge 2.3.0: Now the reconfigure function on the filter is called but it is called in a loop infinitely after making a single config change: image After that the dispatcher service soon goes unresponsive, until Fledge kills and restarts it (which does not stop the infinite call).

FlorentP42 commented 9 months ago

Tested on Fledge 2.3.0-47 nightly, now the observed behavior is as follow:

NB: Adding a Fledge restart after updating the filter configuration does not help either.

MarkRiddoch commented 9 months ago

It looks like the merge of the fix lost a line of code. This has now be reinstated and has resolved the issue with the repeated logs. This will appear in the next night build. Apologies for this merge issue.

FlorentP42 commented 9 months ago

Tested on Fledge 2.3.0-73, this issue seems to be fixed completely in that nightly :)