Skip to content

[hostcfgd] [202012] Enhance hostcfgd to check feature state and run less system calls#8157

Merged
vaibhavhd merged 2 commits intosonic-net:202012from
shlomibitton:shlomi_hostcfgd_enhance_202012
Jul 13, 2021
Merged

[hostcfgd] [202012] Enhance hostcfgd to check feature state and run less system calls#8157
vaibhavhd merged 2 commits intosonic-net:202012from
shlomibitton:shlomi_hostcfgd_enhance_202012

Conversation

@shlomibitton
Copy link
Contributor

Signed-off-by: Shlomi Bitton shlomibi@nvidia.com

Why I did it

Currently hostcfgd is implemented in a way each feature which is enabled/disabled triggering execution of systemctl enable/unmask commands which eventually trigger 'systemctl daemon-reload' command.
Each call like this cost 0.6s and overall add a overhead of ~12 seconds of CPU time.
This change will verify the desired state of a feature and the current state of this feature on systemd and trigger a system call only when must.

How I did it

Check each feature status on systemd before executing a system call to enable and reload the systemctl daemon.

How to verify it

Build an image with this change and observe less system calls are executed.

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106

Description for the changelog

A picture of a cute animal (not mandatory but encouraged)

Shlomi Bitton and others added 2 commits July 12, 2021 14:54
…cuting a system call.

Adapt the unit tests to the new change.
Add another UT to verify daemon behavior when no system calls are required.

Signed-off-by: Shlomi Bitton <shlomibi@nvidia.com>
@shlomibitton
Copy link
Contributor Author

@yxieca can you please check the warm_boot test failure? It does not seems to be related to this change.
I see in the test failure: "WARNING: No route found for IPv6 destination"

@vaibhavhd
Copy link
Contributor

@yxieca can you please check the warm_boot test failure? It does not seems to be related to this change.
I see in the test failure: "WARNING: No route found for IPv6 destination"

The real failure here is the exceeded downtime:
downtime"FAILED:dut:Longest downtime period must be less then 200 seconds. It was 0:03:24.487656"

The "WARNING: No route found for IPv6 destination" is benign and appears on every run of this test.

I have triggered a re-run and this should likely pass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants