This is an automated email from the ASF dual-hosted git repository.
jackietien pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/master by this push:
new 9fb66af4084 Avoid potential deadlock in TableFunctionLeafOperator
9fb66af4084 is described below
commit 9fb66af40840d527c0f7170579dfc1f3dc3d5736
Author: Jackie Tien <[email protected]>
AuthorDate: Tue Jul 22 19:49:57 2025 +0800
Avoid potential deadlock in TableFunctionLeafOperator
---
.../operator/process/function/TableFunctionLeafOperator.java | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/operator/process/function/TableFunctionLeafOperator.java
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/operator/process/function/TableFunctionLeafOperator.java
index 581b75b5738..a52e12358bb 100644
---
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/operator/process/function/TableFunctionLeafOperator.java
+++
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/operator/process/function/TableFunctionLeafOperator.java
@@ -26,6 +26,7 @@ import org.apache.iotdb.rpc.TSStatusCode;
import
org.apache.iotdb.udf.api.relational.table.TableFunctionProcessorProvider;
import
org.apache.iotdb.udf.api.relational.table.processor.TableFunctionLeafProcessor;
+import com.google.common.util.concurrent.ListenableFuture;
import org.apache.tsfile.block.column.ColumnBuilder;
import org.apache.tsfile.enums.TSDataType;
import org.apache.tsfile.read.common.block.TsBlock;
@@ -44,6 +45,7 @@ public class TableFunctionLeafOperator implements
ProcessOperator {
private final TsBlockBuilder blockBuilder;
private final TableFunctionLeafProcessor processor;
+ private volatile boolean init = false;
public TableFunctionLeafOperator(
OperatorContext operatorContext,
@@ -51,10 +53,18 @@ public class TableFunctionLeafOperator implements
ProcessOperator {
List<TSDataType> outputDataTypes) {
this.operatorContext = operatorContext;
this.processor = processorProvider.getSplitProcessor();
- this.processor.beforeStart();
this.blockBuilder = new TsBlockBuilder(outputDataTypes);
}
+ @Override
+ public ListenableFuture<?> isBlocked() {
+ if (!init) {
+ init = true;
+ processor.beforeStart();
+ }
+ return NOT_BLOCKED;
+ }
+
@Override
public OperatorContext getOperatorContext() {
return this.operatorContext;