Github user cloud-fan commented on a diff in the pull request:

    https://github.com/apache/spark/pull/18083#discussion_r121021258
  
    --- Diff: 
core/src/test/scala/org/apache/spark/scheduler/SparkListenerSuite.scala ---
    @@ -138,6 +162,44 @@ class SparkListenerSuite extends SparkFunSuite with 
LocalSparkContext with Match
         assert(drained)
       }
     
    +  test("metrics for dropped listener events") {
    +    val bus = new LiveListenerBus(new 
SparkConf().set(LISTENER_BUS_EVENT_QUEUE_CAPACITY, 1))
    +
    +    val listenerStarted = new Semaphore(0)
    +    val listenerWait = new Semaphore(0)
    +
    +    bus.addListener(new SparkListener {
    +      override def onJobEnd(jobEnd: SparkListenerJobEnd): Unit = {
    +        listenerStarted.release()
    +        listenerWait.acquire()
    +      }
    +    })
    +
    +    bus.start(mockSparkContext, mockMetricsSystem)
    +
    +    // Post a message to the listener bus and wait for processing to begin:
    +    bus.post(SparkListenerJobEnd(0, jobCompletionTime, JobSucceeded))
    +    listenerStarted.acquire()
    --- End diff --
    
    is this deterministic that this line will be run before 
`listenerStarted.release()` in `onJobEnd`?


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