HappenLee commented on a change in pull request #8117: URL: https://github.com/apache/incubator-doris/pull/8117#discussion_r809718536
########## 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: HEADER_LEN is 8 ? uint64? ########## 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(INFO) << "warning: Status msg truncated" << std::endl; Review comment: why not use `LOG(WARNING)` and glog not need `std::endl`; -- 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...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org