Nir Soffer has uploaded a new change for review.
Change subject: network: Use new concurrent.thread() utility ......................................................................
network: Use new concurrent.thread() utility
This patch updates the networking subsystem to use the new utility.
Behavior changes:
- dhclient.DhcpClient threads are protected from silent failures - configurators/ifcfg._ifup threads are proected from silent failures.
Change-Id: I62e80bbbb9354d3173cce631ed5579532cf7cdcb Relates-To: https://bugzilla.redhat.com/1141422 Signed-off-by: Nir Soffer nsoffer@redhat.com --- M vdsm/network/configurators/dhclient.py M vdsm/network/configurators/ifcfg.py M vdsm/network/sourceroutethread.py 3 files changed, 8 insertions(+), 14 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/53/45553/1
diff --git a/vdsm/network/configurators/dhclient.py b/vdsm/network/configurators/dhclient.py index 181c302..a25ae8f 100644 --- a/vdsm/network/configurators/dhclient.py +++ b/vdsm/network/configurators/dhclient.py @@ -23,8 +23,8 @@ import logging import os import signal -import threading
+from vdsm import concurrent from vdsm import cmdutils from vdsm import ipwrapper from vdsm import netinfo @@ -76,9 +76,8 @@ rc, _, _ = self._dhclient() return rc else: - t = threading.Thread(target=self._dhclient, name='vdsm-dhclient-%s' - % self.iface) - t.daemon = True + t = concurrent.thread(self._dhclient, + name='vdsm-dhclient-%s' % self.iface) t.start()
def shutdown(self): diff --git a/vdsm/network/configurators/ifcfg.py b/vdsm/network/configurators/ifcfg.py index e1d3e94..f676f83 100644 --- a/vdsm/network/configurators/ifcfg.py +++ b/vdsm/network/configurators/ifcfg.py @@ -28,11 +28,11 @@ import re import selinux import shutil -import threading
from libvirt import libvirtError, VIR_ERR_NO_NETWORK
from vdsm.config import config +from vdsm import concurrent from vdsm import cmdutils from vdsm import constants from vdsm import ipwrapper @@ -782,9 +782,8 @@ if not iface.blockingdhcp and (iface.ipv4.bootproto == 'dhcp' or iface.ipv6.dhcpv6): # wait for dhcp in another thread, so vdsm won't get stuck (BZ#498940) - t = threading.Thread(target=_exec_ifup, name='ifup-waiting-on-dhcp', - args=(iface.name, cgroup)) - t.daemon = True + t = concurrent.thread(_exec_ifup, name='ifup-waiting-on-dhcp', + args=(iface.name, cgroup)) t.start() else: _exec_ifup(iface.name, cgroup) diff --git a/vdsm/network/sourceroutethread.py b/vdsm/network/sourceroutethread.py index 0a49760..042e5bd 100644 --- a/vdsm/network/sourceroutethread.py +++ b/vdsm/network/sourceroutethread.py @@ -19,12 +19,11 @@ from __future__ import absolute_import import logging import os -import threading
import pyinotify
from vdsm.constants import P_VDSM_RUN -from vdsm import utils +from vdsm import concurrent
from .configurators.iproute2 import Iproute2 from .sourceroute import DynamicSourceRoute @@ -68,13 +67,10 @@
def start(): - thread = threading.Thread(target=_subscribeToInotifyLoop, - name='sourceRoute') - thread.daemon = True + thread = concurrent.thread(_subscribeToInotifyLoop, name='sourceRoute') thread.start()
-@utils.traceback() def _subscribeToInotifyLoop(): logging.debug("sourceRouteThread.subscribeToInotifyLoop started")
automation@ovirt.org has posted comments on this change.
Change subject: network: Use new concurrent.thread() utility ......................................................................
Patch Set 1:
* Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
automation@ovirt.org has posted comments on this change.
Change subject: network: Use new concurrent.thread() utility ......................................................................
Patch Set 2:
* Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
Ido Barkan has posted comments on this change.
Change subject: network: Use new concurrent.thread() utility ......................................................................
Patch Set 2: Code-Review+1
gerrit-hooks has posted comments on this change.
Change subject: network: Use new concurrent.thread() utility ......................................................................
Patch Set 3:
* Update tracker: IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.6', 'ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
Nir Soffer has posted comments on this change.
Change subject: network: Use new concurrent.thread() utility ......................................................................
Patch Set 3: Verified+1
Ido Barkan has posted comments on this change.
Change subject: network: Use new concurrent.thread() utility ......................................................................
Patch Set 3: Code-Review+1
Jenkins CI RO has abandoned this change.
Change subject: network: Use new concurrent.thread() utility ......................................................................
Abandoned
Abandoned due to no activity - please restore if still relevant
gerrit-hooks has posted comments on this change.
Change subject: network: Use new concurrent.thread() utility ......................................................................
Patch Set 3:
* Update tracker: IGNORE, no Bug-Url found
Nir Soffer has restored this change.
Change subject: network: Use new concurrent.thread() utility ......................................................................
Restored
vdsm-patches@lists.fedorahosted.org