[common] Ensure ParallelExecution waits for reader cleanup - #8855
Conversation
ParallelExecution marks tasks complete before reader cleanup, while close only interrupts the executor. It can therefore return before input streams are released. Wait for executor termination in close and cover the race with a controlled concurrency test. Signed-off-by: QuakeWang <wangfuzheng0814@foxmail.com>
|
Could we avoid interrupting workers that have already finished reading and are only closing their readers?
I reproduced this with a reader whose For the normal completed-read path, could we use |
|
Thanks @JingsongLi for catching this. You are right that Fixed in I also changed the test to use interruptible semaphore acquisition and propagate interruption as an |
|
+1 |
Purpose
ParallelExecutionmarks tasks complete before closing the underlying readers, whileclose()previously only interrupted the executor. As a result,close()could return while reader cleanup was still running, leaving input streams temporarilyopen.
Wait for executor termination in
close()so reader resources are released before it returns. Add deterministic coverage for the race and remove the sleep workaround fromIndexBootstrapTest.Tests
mvn -pl paimon-core -am -DfailIfNoTests=false -DwildcardSuites=none -Dtest=ParallelExecutionTest,IndexBootstrapTest testtestBootstrapIgnoresQueryAuth1,000 times concurrently on JDK 11