Copilot commented on code in PR #12984:
URL: https://github.com/apache/gluten/pull/12984#discussion_r4044281090
##########
cpp/velox/shuffle/VeloxShuffleReader.cc:
##########
@@ -865,10 +911,18 @@ void
VeloxRssSortShuffleReaderDeserializer::VeloxInputStream::next(bool throwIfP
GLUTEN_ASSIGN_OR_THROW(int64_t realBytes, in_->Read(readBytes,
buffer_->asMutable<char>()));
if (realBytes > 0) {
offset_ = realBytes;
+ totalBytesRead_ += realBytes;
+ atEnd_ = false;
setRange({buffer_->asMutable<uint8_t>(), static_cast<int32_t>(realBytes),
0});
- } else if (throwIfPastEnd) {
- VELOX_FAIL(
- "Reading past end of
VeloxRssSortShuffleReaderDeserializer::VeloxInputStream, real bytes = {}",
realBytes);
+ } else {
Review Comment:
`Read()` uses zero to signal EOS, but this branch also treats any negative
`realBytes` as a clean end-of-stream. A buggy upstream can therefore silently
truncate the partition and return no batch instead of failing fast (the
negative-return case is part of #12985). Validate that the result is
non-negative before setting `atEnd_`.
--
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]