Skip to content

Conversation

@ericvandenbergfb-zz
Copy link

inprogress history file in some cases.

Add failure handling for EOFException that can be thrown during
decompression of an inprogress spark history file, treat same as case
where can't parse the last line.

What changes were proposed in this pull request?

Failure handling for case of EOFException thrown within the ReplayListenerBus.replay method to handle the case analogous to json parse fail case. This path can arise in compressed inprogress history files since an incomplete compression block could be read (not flushed by writer on a block boundary). See the stack trace of this occurrence in the jira ticket (https://issues.apache.org/jira/browse/SPARK-21447)

How was this patch tested?

Added a unit test that specifically targets validating the failure handling path appropriately when maybeTruncated is true and false.

inprogress history file in some cases.

Add failure handling for EOFException that can be thrown during
decompression of an inprogress spark history file, treat same as case
where can't parse the last line.
@vanzin
Copy link
Contributor

vanzin commented Jul 18, 2017

ok to test

@SparkQA
Copy link

SparkQA commented Jul 18, 2017

Test build #79714 has finished for PR 18673 at commit caeac28.

  • This patch fails Scala style tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

// If the history event file is compressed and inprogress, the compressor will throw an
// EOFException if there is not enough to decompress a proper frame. This indicates
// we're at the end of the file so we treat similarly to the JsonParseException case above.
if (!maybeTruncated) {
Copy link
Contributor

Choose a reason for hiding this comment

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

You can merge this with the case.

case _: EOFException if !maybeTruncated =>

Choose a reason for hiding this comment

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

Okay, nice short syntax.

if (!maybeTruncated) {
throw eofe
} else {
logWarning(s"Got EOFException from log file $sourceName" +
Copy link
Contributor

Choose a reason for hiding this comment

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

Since this is sort of expected for in progress apps, warning is a little too much. The message is also misleading, since it's expected to not be finished yet.

(I know it's the same message as the existing handling of maybeTruncated, but the same comment applies there.)

Choose a reason for hiding this comment

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

Agree, the message doesn't add much value since this is expected behavior. Will remove.

@SparkQA
Copy link

SparkQA commented Jul 18, 2017

Test build #79720 has finished for PR 18673 at commit 484141a.

  • This patch fails Scala style tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Jul 19, 2017

Test build #79731 has finished for PR 18673 at commit b82847e.

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

Copy link
Contributor

@jiangxb1987 jiangxb1987 left a comment

Choose a reason for hiding this comment

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

LGTM

@vanzin
Copy link
Contributor

vanzin commented Jul 25, 2017

Merging to master / 2.2.

@asfgit asfgit closed this in 06a9793 Jul 25, 2017
asfgit pushed a commit that referenced this pull request Jul 25, 2017
inprogress history file in some cases.

Add failure handling for EOFException that can be thrown during
decompression of an inprogress spark history file, treat same as case
where can't parse the last line.

## What changes were proposed in this pull request?

Failure handling for case of EOFException thrown within the ReplayListenerBus.replay method to handle the case analogous to json parse fail case.  This path can arise in compressed inprogress history files since an incomplete compression block could be read (not flushed by writer on a block boundary).  See the stack trace of this occurrence in the jira ticket (https://issues.apache.org/jira/browse/SPARK-21447)

## How was this patch tested?

Added a unit test that specifically targets validating the failure handling path appropriately when maybeTruncated is true and false.

Author: Eric Vandenberg <ericvandenberg@fb.com>

Closes #18673 from ericvandenbergfb/fix_inprogress_compr_history_file.

(cherry picked from commit 06a9793)
Signed-off-by: Marcelo Vanzin <vanzin@cloudera.com>
glentakahashi pushed a commit to glentakahashi/spark that referenced this pull request Aug 16, 2017
inprogress history file in some cases.

Add failure handling for EOFException that can be thrown during
decompression of an inprogress spark history file, treat same as case
where can't parse the last line.

## What changes were proposed in this pull request?

Failure handling for case of EOFException thrown within the ReplayListenerBus.replay method to handle the case analogous to json parse fail case.  This path can arise in compressed inprogress history files since an incomplete compression block could be read (not flushed by writer on a block boundary).  See the stack trace of this occurrence in the jira ticket (https://issues.apache.org/jira/browse/SPARK-21447)

## How was this patch tested?

Added a unit test that specifically targets validating the failure handling path appropriately when maybeTruncated is true and false.

Author: Eric Vandenberg <ericvandenberg@fb.com>

Closes apache#18673 from ericvandenbergfb/fix_inprogress_compr_history_file.
MatthewRBruce pushed a commit to Shopify/spark that referenced this pull request Jul 31, 2018
inprogress history file in some cases.

Add failure handling for EOFException that can be thrown during
decompression of an inprogress spark history file, treat same as case
where can't parse the last line.

## What changes were proposed in this pull request?

Failure handling for case of EOFException thrown within the ReplayListenerBus.replay method to handle the case analogous to json parse fail case.  This path can arise in compressed inprogress history files since an incomplete compression block could be read (not flushed by writer on a block boundary).  See the stack trace of this occurrence in the jira ticket (https://issues.apache.org/jira/browse/SPARK-21447)

## How was this patch tested?

Added a unit test that specifically targets validating the failure handling path appropriately when maybeTruncated is true and false.

Author: Eric Vandenberg <ericvandenberg@fb.com>

Closes apache#18673 from ericvandenbergfb/fix_inprogress_compr_history_file.

(cherry picked from commit 06a9793)
Signed-off-by: Marcelo Vanzin <vanzin@cloudera.com>
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