Change in vdsm[master]: netlink: Introduce socket pool
danken at redhat.com
danken at redhat.com
Thu Feb 20 14:41:10 UTC 2014
Dan Kenigsberg has posted comments on this change.
Change subject: netlink: Introduce socket pool
......................................................................
Patch Set 3:
(1 comment)
http://gerrit.ovirt.org/#/c/24603/3/lib/vdsm/netlink.py
File lib/vdsm/netlink.py:
Line 109: @contextmanager
Line 110: def socket(self):
Line 111: """Takes a netlink socket from the pool and returns it afterwards."""
Line 112: with self._semaphore:
Line 113: sock = self._sockets.pop()
> How do you handle errors when socket is created? This will make the code ev
If a function fails to open a netlink socket, it simply explodes. Just like if it fails to read the nl_cache. There's nothing much we can do.
Since it's only 3 fd wasted, populating the pool ahead of time is not very expensive.
Line 114: try:
Line 115: yield sock
Line 116: finally:
Line 117: self._sockets.add(sock)
--
To view, visit http://gerrit.ovirt.org/24603
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I657ac3d3e0c2661ce73bdef9aa807ead888a42eb
Gerrit-PatchSet: 3
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Antoni Segura Puimedon <asegurap at redhat.com>
Gerrit-Reviewer: Antoni Segura Puimedon <asegurap at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
More information about the vdsm-patches
mailing list