Copilot commented on code in PR #2302:
URL: 
https://github.com/apache/incubator-pegasus/pull/2302#discussion_r2445410302


##########
src/meta/meta_state_service_zookeeper.cpp:
##########
@@ -199,7 +200,7 @@ 
meta_state_service_zookeeper::new_transaction_entries(unsigned int capacity)
                                        tsk,                                    
                    \
                                        std::placeholders::_1);                 
                    \
     op->_optype = op_type;                                                     
                    \
-    input->_path = node;
+    input->_path = std::make_shared<std::string>(node)

Review Comment:
   Missing semicolon at the end of the statement. This will cause a compilation 
error.
   ```suggestion
       input->_path = std::make_shared<std::string>(node);
   ```



##########
src/zookeeper/lock_struct.cpp:
##########
@@ -637,20 +644,23 @@ void lock_struct::create_locknode()
         }
 
         if (op->_output.error != ZOK) {
-            EXECUTE(
-                std::bind(&lock_struct::after_create_locknode, _this, 
op->_output.error, nullptr),
+            enqueue(
+                [_this, err = op->_output.error]() {
+                    lock_struct::after_create_locknode(_this, err, nullptr);
+                },
                 _this);
             return;
         }
 
         std::shared_ptr<std::string> path(new 
std::string(op->_output.create_op._created_path));
-        EXECUTE(std::bind(&lock_struct::after_create_locknode, _this, ZOK, 
path), _this);
+        enqueue([_this, path]() { lock_struct::after_create_locknode(_this, 
ZOK, path); }, _this);
     };
 
     zookeeper_session::zoo_input &input = op->_input;
-    input._path = _lock_dir + "/" + 
distributed_lock_service_zookeeper::LOCK_NODE_PREFIX;
+    input._path = std::make_shared<std::string>(
+        fmt::format("{}/{}", _lock_dir, 
distributed_lock_service_zookeeper::LOCK_NODE_PREFIX));
     input._value.assign(_myself._node_value.c_str(), 0, 
_myself._node_value.length());
-    input._flags = ZOO_EPHEMERAL | ZOO_SEQUENCE;
+    input._flags = ZOO_EPHEMERAL_SEQUENTIAL;

Review Comment:
   The flag value `ZOO_EPHEMERAL_SEQUENTIAL` does not exist in the ZooKeeper C 
API. The correct combination is `ZOO_EPHEMERAL | ZOO_SEQUENCE`. This change 
will cause a compilation error or incorrect behavior.
   ```suggestion
       input._flags = ZOO_EPHEMERAL | ZOO_SEQUENCE;
   ```



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to