Skip to content

[SPARK-6197][CORE] handle json exception when hisotry file not finished writing #4927

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from

Conversation

liyezhang556520
Copy link
Contributor

For details, please refer to SPARK-6197

@SparkQA
Copy link

SparkQA commented Mar 6, 2015

Test build #28328 has started for PR 4927 at commit 2973024.

  • This patch merges cleanly.

@liyezhang556520
Copy link
Contributor Author

cc @srowen, @andrewor14, @viirya

@viirya
Copy link
Member

viirya commented Mar 6, 2015

@liyezhang556520 do you really encounter this problem? Isn't the writing operation atomic?

@liyezhang556520
Copy link
Contributor Author

Yes, I do encounter the problem, if you use Ctrl+C during tasks finishing, it's easy to happen.

@zsxwing
Copy link
Member

zsxwing commented Mar 6, 2015

@liyezhang556520 do you really encounter this problem? Isn't the writing operation atomic?

The writing operation is not atomic.

@liyezhang556520
Copy link
Contributor Author

And I don't think writing operation is atomic, signals still can iterrupt

@liyezhang556520
Copy link
Contributor Author

ok, thanks @zsxwing answer the second question.

@SparkQA
Copy link

SparkQA commented Mar 6, 2015

Test build #28328 has finished for PR 4927 at commit 2973024.

  • This patch passes all 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/28328/
Test PASSed.

def replay(
logData: InputStream,
sourceName: String,
sourceTruncated: Boolean = false): Unit = {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: let's call this maybeTruncated? it's not certain that the file is truncated.

@SparkQA
Copy link

SparkQA commented Mar 6, 2015

Test build #28344 has started for PR 4927 at commit 2b48831.

  • This patch merges cleanly.

@liyezhang556520
Copy link
Contributor Author

@srowen , thanks for your comments, and I have updated the code.

try {
replayBus.replay(logInput, eventLogFile)
replayBus.replay(logInput, eventLogFile,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK by me except this line no longer needs to wrap. Maybe see if others have a comment before bothering to update again.

@SparkQA
Copy link

SparkQA commented Mar 6, 2015

Test build #28345 has started for PR 4927 at commit 5cbdc82.

  • This patch merges cleanly.

@SparkQA
Copy link

SparkQA commented Mar 6, 2015

Test build #28344 has finished for PR 4927 at commit 2b48831.

  • This patch passes all 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/28344/
Test PASSed.

@SparkQA
Copy link

SparkQA commented Mar 6, 2015

Test build #28345 has finished for PR 4927 at commit 5cbdc82.

  • This patch passes all 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/28345/
Test PASSed.

@srowen
Copy link
Member

srowen commented Mar 6, 2015

Thoughts, @viirya @zsxwing ?

@viirya
Copy link
Member

viirya commented Mar 6, 2015

Hmm, just being curious, replay originally has a try...catch block outside the log reading, and this pr adds another one in the reading. Is it better to combine two try...catch blocks together for readability?

@liyezhang556520
Copy link
Contributor Author

@viirya , that is because we need to check whether lines iterator is exhausted (by checking lines.hasNext) to decide whether we can ignore the exception, and the lines is only available in the try block.

@viirya
Copy link
Member

viirya commented Mar 6, 2015

Ah, not notice that. :-)

@@ -17,6 +17,7 @@

package org.apache.spark.scheduler

import com.fasterxml.jackson.core.JsonParseException
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zsxwing
Copy link
Member

zsxwing commented Mar 13, 2015

LGTM except the minor import order problem.

@srowen
Copy link
Member

srowen commented Mar 13, 2015

I can fix the import on merge.

@asfgit asfgit closed this in 9048e81 Mar 13, 2015
zzcclp pushed a commit to zzcclp/spark that referenced this pull request Mar 16, 2015
…ed writing

For details, please refer to [SPARK-6197](https://issues.apache.org/jira/browse/SPARK-6197)

Author: Zhang, Liye <liye.zhang@intel.com>

Closes apache#4927 from liyezhang556520/jsonParseError and squashes the following commits:

5cbdc82 [Zhang, Liye] without unnecessary wrap
2b48831 [Zhang, Liye] small changes with sean owen's comments
2973024 [Zhang, Liye] handle json exception when file not finished writing

Conflicts:
	core/src/main/scala/org/apache/spark/deploy/master/Master.scala
@liyezhang556520 liyezhang556520 deleted the jsonParseError branch March 20, 2015 05:18
asfgit pushed a commit that referenced this pull request May 16, 2015
…ed writing

For details, please refer to [SPARK-6197](https://issues.apache.org/jira/browse/SPARK-6197)

Author: Zhang, Liye <liye.zhang@intel.com>

Closes #4927 from liyezhang556520/jsonParseError and squashes the following commits:

5cbdc82 [Zhang, Liye] without unnecessary wrap
2b48831 [Zhang, Liye] small changes with sean owen's comments
2973024 [Zhang, Liye] handle json exception when file not finished writing
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.

6 participants