Skip to content

Conversation

@zsxwing
Copy link
Member

@zsxwing zsxwing commented Sep 23, 2016

What changes were proposed in this pull request?

Log how many Spark events got dropped in LiveListenerBus so that the user can get insights on how to set a correct event queue size.

How was this patch tested?

Jenkins

@zsxwing
Copy link
Member Author

zsxwing commented Sep 23, 2016

/cc @yhuai

// and we will try again.
if (droppedEventsCounter.compareAndSet(droppedEvents, 0)) {
lastReportTimestamp = System.currentTimeMillis()
logWarning(s"Dropped $droppedEvents SparkListenerEvents")
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we also log the lastReportTimestamp?

Copy link
Member Author

Choose a reason for hiding this comment

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

Should we also log the lastReportTimestamp?

I don't think so since the log itself has the time info already.

// Don't log too frequently
if (System.currentTimeMillis() - lastReportTimestamp >= 60 * 1000) {
var droppedEvents = droppedEventsCounter.get
while (droppedEvents > 0) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I do not quite get the purpose of this while loop. Should we just move forward if droppedEventsCounter.compareAndSet(droppedEvents, 0) fail? When compareAndSet fails, there must be another thread that has triggered the log, right?

Copy link
Member Author

Choose a reason for hiding this comment

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

I do not quite get the purpose of this while loop. Should we just move forward if droppedEventsCounter.compareAndSet(droppedEvents, 0) fail? When compareAndSet fails, there must be another thread that has triggered the log, right?

The loop is not necessary. Updated. Also modified to check droppedEvents > 0 first so that don't need to call System.currentTimeMillis() in most of cases.

@SparkQA
Copy link

SparkQA commented Sep 23, 2016

Test build #65836 has finished for PR 15220 at commit f580ce1.

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

/** A counter for dropped events. It will be reset every time we log it. */
private val droppedEventsCounter = new AtomicLong(0L)

/** When `droppedEventsCounter` was logged last time. */
Copy link
Contributor

Choose a reason for hiding this comment

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

Mention that it stores millis?

@yhuai
Copy link
Contributor

yhuai commented Sep 23, 2016

LGTM. Just left one comment to make the comment a little bit more clear.

@SparkQA
Copy link

SparkQA commented Sep 23, 2016

Test build #65843 has finished for PR 15220 at commit b4f56a0.

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

@SparkQA
Copy link

SparkQA commented Sep 23, 2016

Test build #65847 has finished for PR 15220 at commit 2f47c30.

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

@zsxwing
Copy link
Member Author

zsxwing commented Sep 23, 2016

Thanks! Merging to master / 2.0. I will submit a patch for 1.6.

@SparkQA
Copy link

SparkQA commented Sep 24, 2016

Test build #65851 has finished for PR 15220 at commit 77d7ba0.

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

asfgit pushed a commit that referenced this pull request Sep 26, 2016
…enerBus

## What changes were proposed in this pull request?

Log how many Spark events got dropped in LiveListenerBus so that the user can get insights on how to set a correct event queue size.

## How was this patch tested?

Jenkins

Author: Shixiong Zhu <[email protected]>

Closes #15220 from zsxwing/SPARK-17649.

(cherry picked from commit bde85f8)
Signed-off-by: Shixiong Zhu <[email protected]>
@asfgit asfgit closed this in bde85f8 Sep 26, 2016
@zsxwing zsxwing deleted the SPARK-17649 branch September 26, 2016 17:47
asfgit pushed a commit that referenced this pull request Sep 26, 2016
…nousListenerBus (branch 1.6)

## What changes were proposed in this pull request?

Backport #15220 to 1.6.

## How was this patch tested?

Jenkins

Author: Shixiong Zhu <[email protected]>

Closes #15226 from zsxwing/SPARK-17649-branch-1.6.
zzcclp pushed a commit to zzcclp/spark that referenced this pull request Sep 27, 2016
…nousListenerBus (branch 1.6)

## What changes were proposed in this pull request?

Backport apache#15220 to 1.6.

## How was this patch tested?

Jenkins

Author: Shixiong Zhu <[email protected]>

Closes apache#15226 from zsxwing/SPARK-17649-branch-1.6.

(cherry picked from commit 7aded55)
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.

3 participants