`TaskLock` is shared by tasks only if they have the same groupId (see `TaskLockPosse`). Maybe this works for kafka indexing service because all kafkaIndexTasks for the same dataSource have the same groupId, but it's not always true for other task types.
I think it makes sense to call `toolbox.getIndexerMetadataStorageCoordinator().allocatePendingSegment()` inside of `TaskLockBox.doInCriticalSection()`. It's designed to perform some action in a critical section, so that any other tasks can't revoke the lock of the current task. Also, it guarantees that only one task can perform the action at the same time. Please check `SegmentTransactionalInsertAction` as an example. What do you think? [ Full content available at: https://github.com/apache/incubator-druid/pull/6336 ] This message was relayed via gitbox.apache.org for devnull@infra.apache.org