Piotr Kliczewski has uploaded a new change for review.

Change subject: stomp: improve message id handling during response send
......................................................................

stomp: improve message id handling during response send

Signed-off-by: pkliczewski <piotr.kliczew...@gmail.com>
Change-Id: I21102b03245da7906d5618ba9e0f9811e8864c34
---
M lib/yajsonrpc/stompreactor.py
1 file changed, 14 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/85/49185/1

diff --git a/lib/yajsonrpc/stompreactor.py b/lib/yajsonrpc/stompreactor.py
index 6006786..823f19d 100644
--- a/lib/yajsonrpc/stompreactor.py
+++ b/lib/yajsonrpc/stompreactor.py
@@ -322,12 +322,21 @@
         resp = json.loads(message)
         response_id = resp.get("id")
 
-        try:
-            destination = self._req_dest[response_id]
-            del self._req_dest[response_id]
-        except KeyError:
-            # we could have no reply-to or we could send events (no message id)
+        if response_id is None:
+            # events do not have ids
             pass
+        else:
+            try:
+                destination = self._req_dest[response_id]
+            except KeyError:
+                # we could have no reply-to we will use destination
+                # provided as method argument
+                pass
+            try:
+                del self._req_dest[response_id]
+            except KeyError:
+                self.log.warn("Response to a message with id %s was not found",
+                              response_id)
 
         try:
             connections = self._sub_map[destination]


-- 
To view, visit https://gerrit.ovirt.org/49185
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I21102b03245da7906d5618ba9e0f9811e8864c34
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Piotr Kliczewski <piotr.kliczew...@gmail.com>
_______________________________________________
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to