Skip to content

[bug] Background task update_config launched multiple times #1128

@nemesifier

Description

@nemesifier

There's an easy way I can trigger this on the current master:

In the device change page, make sure to have multiple templates, then edit one of the default values provided by templates in the config variable section, even if they're not used in the config.

In the celery worker I see:

[2025-09-24 00:49:27,262: INFO/MainProcess] Task openwisp_controller.connection.tasks.update_config[c0b37457-d389-48cf-b875-cc85b18fca66] received
[2025-09-24 00:49:27,263: INFO/MainProcess] Task openwisp_controller.connection.tasks.update_config[2a9a4b45-a9a8-43bc-ab5b-b2852e3c41ca] received
[2025-09-24 00:49:27,267: INFO/MainProcess] Task openwisp_controller.connection.tasks.update_config[fb23b160-7d21-4487-91e8-3b39ab404e50] received

Sometimes I see it up to 4 times.

I've observed this in prod too by witnessing multiple SSH connection to a device by looking at the syslog output via logread on OpenWrt.

Recommendation

Let's work on this as a follow up of #1124, let's make sure that the config_modified_signal is only sent when the checksum changes and make sure is only sent once.

Let's double check different ways of changing the config and ensure there's a test for each which asserts the config_modified signal is sent only once:

  • Base assumptions for all the tests: one device with at least 2 templates using default variables, have 1 variable not being used
  • Admin: change a device: config and templates
  • Admin: change a template
  • REST APÎ: change a device: config and templates
  • REST API: change a template

Metadata

Metadata

Assignees

Labels

Type

Projects

Status

To do

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions