Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sometimes not possible to add multiple interface in different transactions #938

Closed
mattiaswal opened this issue Feb 10, 2025 · 0 comments · Fixed by #937
Closed

Sometimes not possible to add multiple interface in different transactions #938

mattiaswal opened this issue Feb 10, 2025 · 0 comments · Fixed by #937
Assignees
Labels
bug Something isn't working triage Pending investigation & classification (CCB)

Comments

@mattiaswal
Copy link
Contributor

Current Behavior

Running following test (on update-kernel branch for kernel 6.12.13)

PYTHONHASHSEED=1743598804 ./case/ietf_interfaces/verify_all_interface_types/test.py

resulting in confd crashing:

Feb 10 08:12:41 target kernel: veth0b: left promiscuous mode
Feb 10 08:12:41 target kernel: br-Q: port 2(veth0b) entered disabled state
Feb 10 08:12:41 target dagger[3317]: Aborting: /run/net/7/action/exit/br-Q.40/50-exit.ip failed with exitcode 1
Feb 10 08:12:41 target dagger[3317]: Abandoned generation 8
Feb 10 08:12:41 target confd[3317]: Failed to apply interface configuration
Feb 10 08:12:41 target confd[3317]: Oups, error detected in SR_EV_DONE

This is because dagger has lost the track of dependencies from previous generations (br-Q.40 should depend on br-Q):

admin@target:~$ tree /run/net/7/dag/
/run/net/7/dag/
|-- br-0
|-- br-D
|-- br-Q
|-- br-Q.40
|-- br-X
|-- e1
|-- e2
|-- e2.30
|-- e3
|-- e3.10
|-- e4
|-- e5
|-- e6
|-- e7
|-- gre-v4
|-- gre-v6
|-- gretap-v4
|-- gretap-v6
|-- lo
|-- veth0a
|-- veth0a.20
|-- veth0b
|-- vxlan-v4
`-- vxlan-v6

Expected Behavior

No crash.

Steps To Reproduce

No response

Additional information

No response

@mattiaswal mattiaswal added bug Something isn't working triage Pending investigation & classification (CCB) labels Feb 10, 2025
wkz added a commit that referenced this issue Feb 11, 2025
Fix #938

Before this change, interface dependencies were only setup when
interfaces were created. This led to problems in flows like this:

1.
    configure
        set interface br0
        set interface br0.10
        leave

2.
    configure
        set interface dummy0
        leave

2.
    configure
        no interface br0
        no interface br0.10
        leave

Since neither br0 nor br0.10 was created in (2), no dependencies were
setup. Because of that, when the deletion scripts from generation (2)
are generated when entering (3), dagger is free to execute them in any
order. This means that it may choose to remove br0 before br0.10,
which will mean that br0.10 is already gone when we try to remove it.

Therefore, make sure that we generate the full dependency graph on
every iteration.

Also, get rid of the need to keep on-disk state for VETH pairs, and
use the name as a descriminator for which side to create/delete.
@wkz wkz linked a pull request Feb 11, 2025 that will close this issue
17 tasks
wkz added a commit that referenced this issue Feb 11, 2025
Fix #938

Before this change, interface dependencies were only setup when
interfaces were created. This led to problems in flows like this:

1.
    configure
        set interface br0
        set interface br0.10
        leave

2.
    configure
        set interface dummy0
        leave

2.
    configure
        no interface br0
        no interface br0.10
        leave

Since neither br0 nor br0.10 was created in (2), no dependencies were
setup. Because of that, when the deletion scripts from generation (2)
are generated when entering (3), dagger is free to execute them in any
order. This means that it may choose to remove br0 before br0.10,
which will mean that br0.10 is already gone when we try to remove it.

Therefore, make sure that we generate the full dependency graph on
every iteration.

Also, get rid of the need to keep on-disk state for VETH pairs, and
use the name as a descriminator for which side to create/delete.
wkz added a commit that referenced this issue Feb 11, 2025
Fix #938

Before this change, interface dependencies were only setup when
interfaces were created. This led to problems in flows like this:

1.
    configure
        set interface br0
        set interface br0.10
        leave

2.
    configure
        set interface dummy0
        leave

2.
    configure
        no interface br0
        no interface br0.10
        leave

Since neither br0 nor br0.10 was created in (2), no dependencies were
setup. Because of that, when the deletion scripts from generation (2)
are generated when entering (3), dagger is free to execute them in any
order. This means that it may choose to remove br0 before br0.10,
which will mean that br0.10 is already gone when we try to remove it.

Therefore, make sure that we generate the full dependency graph on
every iteration.

Also, get rid of the need to keep on-disk state for VETH pairs, and
use the name as a descriminator for which side to create/delete.
@wkz wkz closed this as completed in #937 Feb 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage Pending investigation & classification (CCB)
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants