Explorar el Código

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

ghassmo hace 4 años
padre
commit
90892a45b4
Se han modificado 1 ficheros con 4 adiciones y 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 {