HappenLee commented on a change in pull request #8117:
URL: https://github.com/apache/incubator-doris/pull/8117#discussion_r809926658



##########
File path: be/src/common/status.h
##########
@@ -235,21 +238,59 @@ class Status {
     ///   trailing message.
     Status clone_and_append(const Slice& msg) const;
 
-    operator bool() { return this->ok(); }
+    operator bool() const { return this->ok(); }
 
 private:
-    const char* copy_state(const char* state);
+    void assemble_state(TStatusCode::type code, const Slice& msg, int16_t 
precise_code, const Slice& msg2) {
+        DCHECK(code != TStatusCode::OK);
+        uint32_t len1 = msg.size;
+        uint32_t len2 = msg2.size;
+        uint32_t size = len1 + ((len2 > 0) ? (2 + len2) : 0);
+
+        // limited to MESSAGE_LEN
+        if (UNLIKELY(size > MESSAGE_LEN)) {
+            LOG(WARNING) << "warning: Status msg truncated, " << to_string();

Review comment:
       here do not really set the right info, call `to_string()` may get unless 
message

##########
File path: be/src/common/status.h
##########
@@ -16,30 +16,37 @@
 namespace doris {
 
 class Status {
+    enum { 
+        STATE_CAPACITY = 256,
+        HEADER_LEN = 7,
+        MESSAGE_LEN = STATE_CAPACITY - HEADER_LEN

Review comment:
       OK




-- 
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