Github user zsxwing commented on a diff in the pull request:

    https://github.com/apache/spark/pull/15220#discussion_r80323077
  
    --- Diff: 
core/src/main/scala/org/apache/spark/scheduler/LiveListenerBus.scala ---
    @@ -123,6 +129,23 @@ private[spark] class LiveListenerBus(val sparkContext: 
SparkContext) extends Spa
           eventLock.release()
         } else {
           onDropEvent(event)
    +      droppedEventsCounter.incrementAndGet()
    +    }
    +    // Don't log too frequently
    +    if (System.currentTimeMillis() - lastReportTimestamp >= 60 * 1000) {
    +      var droppedEvents = droppedEventsCounter.get
    +      while (droppedEvents > 0) {
    --- End diff --
    
    > 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.


---
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]

Reply via email to