Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-30285

Fix deadlock between LiveListenerBus#stop and AsyncEventQueue#removeListenerOnError

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.3.0, 2.4.0
    • Fix Version/s: 2.4.5, 3.0.0
    • Component/s: Spark Core
    • Labels:
      None

      Description

      There is a deadlock between LiveListenerBus#stop and AsyncEventQueue#removeListenerOnError.

      we can reproduce as follows:

      1. Post some events to LiveListenerBus
      2. Call LiveListenerBus#stop and hold the synchronized lock of bus, waiting until all the events are processed by listeners, then remove all the queues
      3. Event queue would drain out events by posting to its listeners. If a listener is interrupted, it will call AsyncEventQueue#removeListenerOnError,  inside it will call bus.removeListener, trying to acquire synchronized lock of bus, resulting in deadlock

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                wang-shuo Wang Shuo
                Reporter:
                wang-shuo Wang Shuo
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: