Nir Soffer has posted comments on this change.

Change subject: vdsm: lastclient info in jsonrpc
......................................................................


Patch Set 3: Code-Review-1

(2 comments)

http://gerrit.ovirt.org/#/c/28817/3/vdsm/rpc/BindingXMLRPC.py
File vdsm/rpc/BindingXMLRPC.py:

Line 42: 
Line 43: class BindingXMLRPC(object):
Line 44:     def __init__(self, cif, log, host, port, last_client, 
default_bridge):
Line 45:         self.cif = cif
Line 46:         self._last_client = last_client
You cannot have global client address, because we can have multiple clients at 
the same time, and this will override the value to the *last* client, which is 
*not* what we want.

For example:

1. engine connects - last client become engine address
2. vdsClient connects - last client becomes 127.0.0.1
3. thread responding to engine send a reply to engine with client=127.0.0.1

How it should work:

1. engine connects - thread handling this connection store engine adress
2. vdsClient connects - thread handling this connection storage local address
3. thread responding to engine request use thread local client address
Line 47:         self.threadLocal = threading.local()
Line 48:         self.log = log
Line 49:         self.serverIP = host
Line 50:         self.serverPort = port


Line 43: class BindingXMLRPC(object):
Line 44:     def __init__(self, cif, log, host, port, last_client, 
default_bridge):
Line 45:         self.cif = cif
Line 46:         self._last_client = last_client
Line 47:         self.threadLocal = threading.local()
How is this related to the change? Why the threadlocal has to be in the 
bindings instead of cif?
Line 48:         self.log = log
Line 49:         self.serverIP = host
Line 50:         self.serverPort = port
Line 51:         self.defaultBridge = default_bridge


-- 
To view, visit http://gerrit.ovirt.org/28817
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I402e15cb05f89a98dab14491d9da5985335e095e
Gerrit-PatchSet: 3
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Piotr Kliczewski <[email protected]>
Gerrit-Reviewer: Antoni Segura Puimedon <[email protected]>
Gerrit-Reviewer: Dan Kenigsberg <[email protected]>
Gerrit-Reviewer: Nir Soffer <[email protected]>
Gerrit-Reviewer: Piotr Kliczewski <[email protected]>
Gerrit-Reviewer: Saggi Mizrahi <[email protected]>
Gerrit-Reviewer: Yaniv Bronhaim <[email protected]>
Gerrit-Reviewer: [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