Skip to content

Conversation

@JoshRosen
Copy link
Contributor

read() may return fewer bytes than requested; when this occurred, the old code would silently return less data than requested, which might cause stream corruption errors. skip() faces similar issues, too.

This patch fixes several cases where we mis-handle these methods' return values.

This is a backport of #2969 to branch-1.1.

`read()` may return fewer bytes than requested; when this occurred, the old code would silently return less data than requested, which might cause stream corruption errors.  `skip()` faces similar issues, too.

This patch fixes several cases where we mis-handle these methods' return values.

Author: Josh Rosen <joshrosen@databricks.com>

Closes apache#2969 from JoshRosen/file-channel-read-fix and squashes the following commits:

e724a9f [Josh Rosen] Fix similar issue of not checking skip() return value.
cbc03ce [Josh Rosen] Update the other log message, too.
01e6015 [Josh Rosen] file.getName -> file.getAbsolutePath
d961d95 [Josh Rosen] Fix another issue in FileServerSuite.
b9265d2 [Josh Rosen] Fix a similar (minor) issue in TestUtils.
cd9d76f [Josh Rosen] Fix a similar error in Tachyon:
3db0008 [Josh Rosen] Fix a similar read() error in Utils.offsetBytes().
db985ed [Josh Rosen] Fix unsafe usage of FileChannel.read():

Conflicts:
	core/src/main/scala/org/apache/spark/network/ManagedBuffer.scala
	core/src/main/scala/org/apache/spark/shuffle/IndexShuffleBlockManager.scala
	core/src/main/scala/org/apache/spark/storage/DiskStore.scala
	core/src/test/scala/org/apache/spark/FileServerSuite.scala
@SparkQA
Copy link

SparkQA commented Oct 28, 2014

QA tests have started for PR 2974 at commit d82c05b.

  • This patch merges cleanly.

@SparkQA
Copy link

SparkQA commented Oct 28, 2014

QA tests have finished for PR 2974 at commit d82c05b.

  • This patch passes unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@AmplabJenkins
Copy link

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/22349/
Test PASSed.

@rxin
Copy link
Contributor

rxin commented Oct 28, 2014

Merging. Thanks.

asfgit pushed a commit that referenced this pull request Oct 28, 2014
…s (branch-1.1 backport)

`read()` may return fewer bytes than requested; when this occurred, the old code would silently return less data than requested, which might cause stream corruption errors.  `skip()` faces similar issues, too.

This patch fixes several cases where we mis-handle these methods' return values.

This is a backport of #2969 to `branch-1.1`.

Author: Josh Rosen <joshrosen@databricks.com>

Closes #2974 from JoshRosen/spark-4107-branch-1.1-backport and squashes the following commits:

d82c05b [Josh Rosen] [SPARK-4107] Fix incorrect handling of read() and skip() return values
@JoshRosen JoshRosen closed this Oct 28, 2014
@JoshRosen JoshRosen deleted the spark-4107-branch-1.1-backport branch October 28, 2014 20:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants