Uploaded image for project: 'Cassandra'
  1. Cassandra
  2. CASSANDRA-15975

SEP.shutdownAndWait does not wait for termination and SEPExecutor.awaitTermination may hang

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Review In Progress
    • Normal
    • Resolution: Unresolved
    • None
    • Local/Other
    • None
    • Code
    • Low
    • Normal
    • Unit Test
    • All
    • None
    • Hide

      PR / Branch
      CircleCI - unit tests had an unrelated failure in org.apache.cassandra.streaming.async.StreamingInboundHandlerTest

      Show
      PR / Branch CircleCI - unit tests had an unrelated failure in org.apache.cassandra.streaming.async.StreamingInboundHandlerTest

    Description

      SharedExecutorPool.shutdownAndWait calls shutdownNow on the executors it owns, which has the side effect of removing the executor from the list, then uses the same emptied list to try and wait for them to complete shutting down, which completes immediately.
       
      Once fixed by copying the list in SEP.shutdownAndWait, the SEPExecutorTest suite fails with a timeout due to a startup race in SEPWorker.
       
      If a SEPExecutor is shutdown immediately after maybeSchedule creates a new SEPWorker,
      but before it is able to execute the first task then it exits immediately on entering the work loop with a work and task permit reserved for it, which invalidates the work/task permit accounting and prevents calling the shutdown SimpleCondition.signalAll when the last SEPWorker exits.

      Attachments

        Activity

          People

            jmeredithco Jon Meredith
            jmeredithco Jon Meredith
            Jon Meredith
            Benedict Elliott Smith, David Capwell
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated: