device: stop checking the IP configuration state when cancelling activation

The @bond_mode_8023ad test has been seen failing, with a log like this:

  <debug> [...3.0484] device[...] (eth1): Activation: connection 'bond0.0' master deactivated
  <debug> [...3.0484] device[...] (eth1): add_pending_action (2): 'queued-state-change-deactivating'
  <debug> [...3.0484] device[...] (eth1): queue-state[deactivating, reason:new-activation, id:709]: queue state change

What happened is that eth1 has been activating. It was already enslaved
to a bond and was in an ip-config state when the bond was removed.
A change to "deactivating" state has been enqueued. But then this
happened:

  <trace> [...3.0942] device[...] (eth1): ip4: check-state: state done => done, is_failed=0, is_pending=0,
                      is_started=0 temp_na=0, may-fail-4=1, may-fail-6=1; disabled4; manualip4=done; ignore6 manualip6=done
  <trace> [...3.0942] device[...] (eth1): ip: check-state: (combined) state pending => done
  <debug> [...3.0943] device[...] (eth1): ip: set (combined) state done (was pending, reason: check-ip-state)
  <info>  [...3.0943] device (eth1): state change: ip-config -> ip-check (reason 'none', sys-iface-state: 'managed')
  <debug> [...3.0943] device[...] (eth1): add_pending_action (3): 'in-state-change'
  <debug> [...3.0943] device[...] (eth1): queue-state[deactivating, reason:new-activation, id:709]: clear queued state change

The IP config succeeded and the queued "deactivating" change was
overriden by the IP4 check result, prompting a change to "ip-check".
With the master still missing. Not good.

Let's terminate the appempts to check the IP state when we cancel the
activation, so that it doesn't override the enqueued state change.

Fixes-test: @bond_mode_8023ad

https://bugzilla.redhat.com/show_bug.cgi?id=2080928
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1245
This commit is contained in:
Lubomir Rintel 2022-05-29 22:40:10 +02:00
parent 431d139d15
commit a446edf712

View file

@ -15110,6 +15110,9 @@ _cancel_activation(NMDevice *self)
_dispatcher_cleanup(self);
ip_check_gw_ping_cleanup(self);
_dev_ip_state_cleanup(self, AF_INET, FALSE);
_dev_ip_state_cleanup(self, AF_INET6, FALSE);
/* Break the activation chain */
activation_source_clear(self);
}