FrankChen021 opened a new pull request, #20054:
URL: https://github.com/apache/druid/pull/20054

   ### Description
   
   `SuperSorter` could complete its `allDone` future before the asynchronous 
output-partitions listener initialized the progress tracker's ultimate merger 
count. A caller returning from `run().get()` could therefore briefly observe a 
progress digest of `0.0` instead of `1.0`. This surfaced as repeated 
`SuperSorterTest` flakes in the JDK 25 `S*` CI shard.
   
   This change routes every successful sorter completion through a helper that 
initializes the ultimate merger count before publishing `allDone`. 
Initialization is idempotent under the existing `runWorkersLock`, so the 
output-partitions listener can run either before or after worker completion 
without double-setting the tracker.
   
   The regression test delays the output-partitions listener, waits for sorting 
to complete, and verifies that final progress was already initialized before 
releasing the listener.
   
   #### Release note
   
   None. This fixes internal progress-reporting ordering and test flakiness 
without changing configuration, APIs, persisted data, or query results.
   
   <hr>
   
   ##### Key changed/added classes in this PR
   
   * `SuperSorter`
   * `SuperSorterTest`
   
   <hr>
   
   This PR has:
   
   - [x] been self-reviewed.
     - [x] using the [concurrency 
checklist](https://github.com/apache/druid/blob/master/dev/code-review/concurrency.md).
   - [x] added comments explaining the concurrency intent where it is not 
obvious.
   - [x] added or updated unit tests to cover the affected ordering.
   
   Validation:
   
   ```text
   JAVA_HOME=/Library/Java/JavaVirtualMachines/temurin-25.jdk/Contents/Home \
   mvn test -pl processing -am \
     -Dtest='org.apache.druid.frame.processor.SuperSorterTest*' \
     -Dsurefire.failIfNoSpecifiedTests=false \
     -Pskip-static-checks -Dweb.console.skip=true -T1C
   ```
   
   Result: 10,905 tests run, 0 failures, 0 errors, 0 skipped.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to