Explorar o código

reqrep: print warn message instead of panic when receive different reply id from request id

ghassmo %!s(int64=4) %!d(string=hai) anos
pai
achega
90892a45b4
Modificáronse 1 ficheiros con 4 adicións e 1 borrados
  1. 4 1
      src/service/reqrep.rs

+ 4 - 1
src/service/reqrep.rs

@@ -183,7 +183,10 @@ impl ReqProtocol {
                 return Ok(None);
             }
 
-            assert!(reply.get_id() == request.get_id());
+            if reply.get_id() != request.get_id() {
+                warn!("Reply id is not equal to Request id");
+                return Ok(None);
+            }
 
             Ok(Some(reply.get_payload()))
         } else {