tisonkun commented on code in PR #496: URL: https://github.com/apache/curator/pull/496#discussion_r1472736529
########## curator-recipes/src/test/java/org/apache/curator/framework/recipes/leader/ChaosMonkeyCnxnFactory.java: ########## @@ -81,22 +79,19 @@ public void submitRequest(Request si) { && si.type != ZooDefs.OpCode.ping && firstError != 0 && remaining > 0) { - log.debug("Rejected : " + si.toString()); + log.debug("Rejected : {}", si); // Still reject request log.debug("Still not ready for " + remaining + "ms"); Compatibility.serverCnxnClose(si.cnxn); return; } // Submit the request to the legacy Zookeeper server - log.debug("Applied : " + si.toString()); + log.debug("Applied : {}", si); super.submitRequest(si); // Raise an error if a lock is created if ((si.type == ZooDefs.OpCode.create) || (si.type == ZooDefs.OpCode.create2)) { - CreateRequest createRequest = new CreateRequest(); try { - ByteBuffer duplicate = si.request.duplicate(); - duplicate.rewind(); - ByteBufferInputStream.byteBuffer2Record(duplicate, createRequest); + CreateRequest createRequest = si.readRequestRecord(CreateRequest::new); Review Comment: This may cause failures on early ZK versions and we need a testing compatible layer. Let the CI verify if it's the case. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@curator.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org