persistExecutor submits mergeAndPush job to pushExecutor here after completing the persist.
pushExecutor submits abandon segment job to persistExecutor here
pushExecutor uses a blocking queue with 1 capacity and if persistExecutor either uses Synchronous Queue (which it does in case of KafkaIndexTask) or queue with capacity 1 then deadlock can happen. This would be more common in the new KafkaIndexingService which will support incremental handoff as handoffs (which leads to abandoning of segments) for a sequence can interleave with pushing of segments for another sequence.
This can probably be fixed by not using pushBarrier instead using some form of Atomic counter to keep track of existing pushes before abandoning segments. Any thoughts ?
persistExecutorsubmits mergeAndPush job topushExecutorhere after completing the persist.pushExecutorsubmits abandon segment job topersistExecutorherepushExecutoruses a blocking queue with 1 capacity and ifpersistExecutoreither uses Synchronous Queue (which it does in case of KafkaIndexTask) or queue with capacity 1 then deadlock can happen. This would be more common in the new KafkaIndexingService which will support incremental handoff as handoffs (which leads to abandoning of segments) for a sequence can interleave with pushing of segments for another sequence.This can probably be fixed by not using pushBarrier instead using some form of Atomic counter to keep track of existing pushes before abandoning segments. Any thoughts ?