kuryr-kubernetes/kuryr_kubernetes
Michał Dulko 1c2320e11e Prevent pyroute2.IPDB threads leaking
pyroute2.IPDB is an interesting entity. It's much more than a simple
interface to `ip` command, as it is more similar to a database process.
When created IPDB object spawns a thread that will be responsible for
updating the object with changes to the underlying OS. Thread stays up
until the user will call `release()` method.

Turns out code in kuryr_kubernetes.cni.binding wasn't taking that into
account and was slowly leaking threads (and possibly processes). This
became apparent when running Kuryr with CNI daemon enabled.

This commit fixes the problem by switching all IPDB usages to context
managers, so `release()` method is called automatically.  Also the IPDB
objects cache is removed as already released IPDB objects cannot be
reused. kuryr_kubernetes.cni.binding modules were missing unit tests,
this commit adds them as well.

Change-Id: I82afda3f217dac56228677bb66703c3d80e5d751
Closes-Bug: 1728996
2017-11-17 12:30:54 +01:00
..
cmd Implement Guru meditation reports 2017-04-13 03:19:08 +00:00
cni Prevent pyroute2.IPDB threads leaking 2017-11-17 12:30:54 +01:00
controller Ignore the headless services 2017-11-16 18:03:42 +08:00
handlers Remove log translations 2017-03-28 15:13:49 +08:00
objects Add support for service type=LoadBalancer 2017-10-02 14:12:14 +03:00
tests Prevent pyroute2.IPDB threads leaking 2017-11-17 12:30:54 +01:00
__init__.py Implement Guru meditation reports 2017-04-13 03:19:08 +00:00
clients.py Experimental CNI & VIFBridge binding 2016-12-05 18:05:22 +00:00
config.py Add Pool Manager to handle subports 2017-10-10 08:10:14 +00:00
constants.py Add list and show pool commands to Pool Manager 2017-10-10 10:36:10 +00:00
exceptions.py Add MACVLAN based interfaces for nested containers 2017-06-12 13:14:12 +01:00
k8s_client.py Merge "metadata.resourceVersion: Invalid value" 2017-10-09 12:17:01 +00:00
linux_net_utils.py Remove log translations 2017-03-28 15:13:49 +08:00
opts.py Add Pool Manager to handle subports 2017-10-10 08:10:14 +00:00
os_vif_plug_noop.py Add MACVLAN based interfaces for nested containers 2017-06-12 13:14:12 +01:00
os_vif_util.py Replace six.itervalues() with dict.values() in kuryr-kubernetes 2017-08-04 17:13:17 +08:00
utils.py Add asyncio eventloop. 2016-09-01 14:47:47 +02:00
version.py Implement Guru meditation reports 2017-04-13 03:19:08 +00:00
watcher.py Stopping Thread from oslo_service 2017-06-15 09:11:41 +00:00