Dan Kenigsberg has posted comments on this change.

Change subject: netlink: Introduce socket pool
......................................................................


Patch Set 5:

(1 comment)

http://gerrit.ovirt.org/#/c/24603/5/lib/vdsm/netlink.py
File lib/vdsm/netlink.py:

Line 100:         with self._semaphore:
Line 101:             try:
Line 102:                 sock = self._sockets.pop()
Line 103:             except KeyError:
Line 104:                 sock = _open_socket()
> This works, but it would be more clear to write:
Multiple thread can hold _semaphore, so Nir's code is raceful. If 
len(_sockets)==1 and two threads measured that, the second of them to pop() 
would explode.
Line 105:             try:
Line 106:                 yield sock
Line 107:             finally:
Line 108:                 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: 5
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Antoni Segura Puimedon <[email protected]>
Gerrit-Reviewer: Adam Litke <[email protected]>
Gerrit-Reviewer: Antoni Segura Puimedon <[email protected]>
Gerrit-Reviewer: Dan Kenigsberg <[email protected]>
Gerrit-Reviewer: Nir Soffer <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to