Page MenuHomeVyOS Platform

Remove trivial redundancies in calls to config dependency scripts
Closed, ResolvedPublicBUG

Description

This task address the simplest case of T5660: trivial redundancies arising from the need to define dependencies in the general case --- the graph defined by
https://github.com/vyos/vyos-1x/blob/current/data/config-mode-dependencies/vyos-1x.json
---and the use of dependencies for a specific config, which may trigger multiple overlapping conditions.

A simple example is in
https://github.com/vyos/vyos-1x/blob/current/src/conf_mode/firewall.py#L137-L145
dependencies are set in the case of 'group-resync', and always set for 'conntrack'. If one has a config triggering both, the resulting dependency list is:
set_dependents: caller firewall, dependents ['conntrack', 'nat', 'policy-route'] <-- from set_dependents('group_resync', conf)
set_dependents: caller firewall, dependents ['conntrack', 'nat', 'policy-route', 'conntrack'] <-- redundancy added from set_dependents('conntrack', conf)

It is preferable that the author of a config-mode script not try to manage dependency logic with script logic, but rather that the resulting list is dynamically pruned before being called, resulting in:
call_dependents: caller firewall, dependents ['nat', 'policy-route', 'conntrack']

The remaining sources of redundancies will be detailed in the parent task T5660.

Details

Version
-
Is it a breaking change?
Perfectly compatible
Issue type
Performance optimization

Event Timeline

jestabro triaged this task as Normal priority.
jestabro created this object in space S1 VyOS Public.
jestabro changed the task status from Open to Needs testing.Feb 29 2024, 1:10 PM
jestabro changed the task status from Unknown Status to Resolved.Apr 29 2024, 12:17 PM
jestabro moved this task from Need Triage to Finished on the VyOS 1.4 Sagitta (1.4.0-epa3) board.
dmbaturin changed Is it a breaking change? from Unspecified (possibly destroys the router) to Perfectly compatible.
dmbaturin changed Issue type from Unspecified (please specify) to Performance optimization.