You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ja...@apache.org on 2025/08/11 12:20:54 UTC
(iotdb) 14/47: Avoid potential deadlock in TableFunctionLeafOperator
This is an automated email from the ASF dual-hosted git repository.
jackietien pushed a commit to branch rc/2.0.5
in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit f0be2153d4e1119a9673b7f91b85630b98f7f9de
Author: Jackie Tien <ja...@gmail.com>
AuthorDate: Tue Jul 22 19:49:57 2025 +0800
Avoid potential deadlock in TableFunctionLeafOperator
(cherry picked from commit 9fb66af40840d527c0f7170579dfc1f3dc3d5736)
---
.../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;