You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@curator.apache.org by "tisonkun (via GitHub)" <gi...@apache.org> on 2024/02/01 09:40:24 UTC

Re: [PR] CURATOR-XXX. Upgrade ZooKeeper version to 3.9 [curator]

tisonkun commented on code in PR #496:
URL: https://github.com/apache/curator/pull/496#discussion_r1474125212


##########
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:
   OK. It fails.
   
   Let me think if we should drop support <= 3.7 or add a test compatible switch.
   
   cc @kezhuw @eolivelli @cammckenzie @Randgalt 



-- 
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-unsubscribe@curator.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org