Change in vdsm[master]: sourceroute: don't fail to remove a dynamic source route

danken at redhat.com danken at redhat.com
Tue Jun 2 17:07:18 UTC 2015


Dan Kenigsberg has submitted this change and it was merged.

Change subject: sourceroute: don't fail to remove a dynamic source route
......................................................................


sourceroute: don't fail to remove a dynamic source route

There is a known race when removing source routing on ifdown where the device
going down was configured using ifcfg configurator (initscripts) and DHCP.

Routes are removed on ifdown by dhclient (as stated in dhclient-script(8),
HOOKS section) or the kernel, as ifdown-routes, a part of initscripts, claims:

  The routes are actually dropped just by setting the link down, so nothing
  needs to be done

At the same time, VDSM's dhclient-script hook (sourceRoute.sh) is called by
ifdown-eth with reason=STOP and triggers removal of source routing in VDSM's
sourceRoute thread. The thread then tries to remove routes and routing rules,
but is prone to failure if the routes are already removed as described above.

Even though it was tested that in this particular use case (removing source
routing on ifdown) it was not necessary for VDSM to try to remove routes
itself, the behaviour of other parts of the stack is not guaranteed forever.

iproute2 configurator, called by sourceRoute thread, now ignores the error
message saying the route was already gone:

  RTNETLINK answers: No such process

Previously this error would prevent the removal of routing rules, which would
persist on the system after ifdown. testSetupNetworksAddDelDhcp now passes
in all cases.

Change-Id: I6e63d5ceba72be91fdab5ffd9a71ceab398950b9
Signed-off-by: Ondřej Svoboda <osvoboda at redhat.com>
Reviewed-on: https://gerrit.ovirt.org/36652
Continuous-Integration: Jenkins CI
Reviewed-by: Dan Kenigsberg <danken at redhat.com>
---
M vdsm/network/configurators/iproute2.py
1 file changed, 10 insertions(+), 5 deletions(-)

Approvals:
  Ondřej Svoboda: Verified
  Jenkins CI: Passed CI tests
  Dan Kenigsberg: Looks good to me, approved



-- 
To view, visit https://gerrit.ovirt.org/36652
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I6e63d5ceba72be91fdab5ffd9a71ceab398950b9
Gerrit-PatchSet: 7
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Ondřej Svoboda <osvoboda at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Ido Barkan <ibarkan at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Ondřej Svoboda <osvoboda at redhat.com>
Gerrit-Reviewer: Petr Horáček <phoracek at redhat.com>
Gerrit-Reviewer: automation at ovirt.org


More information about the vdsm-patches mailing list