yaooqinn commented on code in PR #13723:
URL: https://github.com/apache/gluten/pull/13723#discussion_r4704957761


##########
cpp/velox/operators/serializer/VeloxColumnarBatchSerializer.cc:
##########
@@ -854,10 +867,21 @@ std::vector<uint8_t> 
VeloxColumnarBatchSerializer::framedSerializeV3Impl(
   framed.insert(framed.end(), statsBlob.begin(), statsBlob.end());
   pushU32LE(framed, numRows);
   pushU32LE(framed, numCols);
+  // Serialize each column straight into the frame, then fill in its length 
prefix.
+  AppendToVectorBuf frameBuf(framed);
+  std::ostream frameStream(&frameBuf);

Review Comment:
   `std::ostream::write` catches a `std::bad_alloc` thrown from `xsputn` and 
only sets badbit, so an OOM while growing the frame surfaces as "failed to 
serialize". Would `frameStream.exceptions(std::ios::badbit);` here be worth it, 
so the original exception reaches the caller? With this class copied into a 
standalone program (g++ 13, 1 GiB `RLIMIT_AS`): default mask gives `good()=0 
bad()=1` and nothing is thrown; with `exceptions(badbit)` the `std::bad_alloc` 
propagates. The `good()` check still covers failbit.



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