Github user aarondav commented on a diff in the pull request:
https://github.com/apache/spark/pull/2969#discussion_r19451609
--- Diff: core/src/main/scala/org/apache/spark/network/ManagedBuffer.scala
---
@@ -81,7 +81,13 @@ final class FileSegmentManagedBuffer(val file: File, val
offset: Long, val lengt
// Just copy the buffer if it's sufficiently small, as memory
mapping has a high overhead.
if (length < MIN_MEMORY_MAP_BYTES) {
val buf = ByteBuffer.allocate(length.toInt)
- channel.read(buf, offset)
+ channel.position(offset)
+ while (buf.remaining() != 0) {
+ if (channel.read(buf) == -1) {
+ throw new IOException("Reached EOF before filling buffer\n" +
+
s"offset=$offset\nfile=${file.getName}\nbuf.remaining=${buf.remaining}")
--- End diff --
getName does not return the full path, we should probably use the path
instead
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]