This is an automated email from the ASF dual-hosted git repository.

michaelsmith pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/impala.git


The following commit(s) were added to refs/heads/master by this push:
     new 37d47d87f IMPALA-11860: Add buffer size to thrift serialize error
37d47d87f is described below

commit 37d47d87ff928c21660fadc35a7a506a7bd8d10a
Author: Michael Smith <[email protected]>
AuthorDate: Tue Jan 24 09:44:05 2023 -0800

    IMPALA-11860: Add buffer size to thrift serialize error
    
    Add the allocated buffer size to thrift serialization errors to help
    debug allocation issues. TMemoryBuffer has a default maxBufferSize of 2
    GiB, this can help identify if we're running into issues due to hitting
    the max buffer size.
    
    Change-Id: Ie8c1fa7d55197d9e70d21080925238ccdacbeddc
    Reviewed-on: http://gerrit.cloudera.org:8080/19440
    Reviewed-by: Csaba Ringhofer <[email protected]>
    Tested-by: Impala Public Jenkins <[email protected]>
---
 be/src/rpc/thrift-util.h | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/be/src/rpc/thrift-util.h b/be/src/rpc/thrift-util.h
index 1c9706ed2..37a782b39 100644
--- a/be/src/rpc/thrift-util.h
+++ b/be/src/rpc/thrift-util.h
@@ -84,7 +84,8 @@ class ThriftSerializer {
       obj->write(protocol_.get());
     } catch (std::exception& e) {
       std::stringstream msg;
-      msg << "Couldn't serialize thrift object:\n" << e.what();
+      msg << "Couldn't serialize thrift object beyond "
+          << mem_buffer_->getBufferSize() << " bytes:\n" << e.what();
       return Status(msg.str());
     }
     mem_buffer_->getBuffer(buffer, len);
@@ -98,7 +99,8 @@ class ThriftSerializer {
       obj->write(protocol_.get());
     } catch (std::exception& e) {
       std::stringstream msg;
-      msg << "Couldn't serialize thrift object:\n" << e.what();
+      msg << "Couldn't serialize thrift object beyond "
+          << mem_buffer_->getBufferSize() << " bytes:\n" << e.what();
       return Status(msg.str());
     }
     *result = mem_buffer_->getBufferAsString();

Reply via email to