github-actions[bot] commented on code in PR #64797:
URL: https://github.com/apache/doris/pull/64797#discussion_r3472560365


##########
be/src/format/arrow/arrow_utils.cpp:
##########
@@ -38,7 +38,17 @@ arrow::Status to_arrow_status(const Status& status) {
         // The length of exception msg returned to the ADBC Client cannot 
larger than 8192,
         // otherwise ADBC Client will receive:
         // `INTERNAL: http2 exception Header size exceeded max allowed size 
(8192)`.
-        return arrow::Status::Invalid(status.to_string_no_stack());
+        // The message is carried in the gRPC trailer (an HTTP2 header) and 
may be
+        // percent-encoded (which can expand its size), so an oversized 
message can break the
+        // response or even crash the flight transport status conversion. 
Truncate it well below
+        // 8192 to leave headroom; the full message is already logged above.
+        constexpr size_t kMaxArrowStatusMsgLen = 4096;

Review Comment:
   The cap still leaves the Arrow Flight error path exposed to the same 
oversized-header failure. This limits the raw `status.to_string_no_stack()` to 
4096 bytes, but the comment above says this string is carried in a gRPC trailer 
and may be percent-encoded before hitting the 8192-byte header limit. If the 
message contains mostly escapable bytes, 4096 raw bytes plus the suffix can 
expand to well over 8KB on the wire, so an external error string can still 
reproduce the `Header size exceeded max allowed size` path this PR is trying to 
harden. Please either make this truncation encode-aware or choose a raw limit 
that stays below the worst-case encoded size, and add a focused test for an 
expansion-heavy long status message.



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