Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@
import org.apache.ignite.internal.processors.query.calcite.exec.TimeoutService;
import org.apache.ignite.internal.processors.query.calcite.exec.TimeoutServiceImpl;
import org.apache.ignite.internal.processors.query.calcite.exec.exp.RexExecutorImpl;
import org.apache.ignite.internal.processors.query.calcite.exec.task.AbstractQueryTaskExecutor;
import org.apache.ignite.internal.processors.query.calcite.exec.task.QueryBlockingTaskExecutor;
import org.apache.ignite.internal.processors.query.calcite.exec.task.StripedQueryTaskExecutor;
import org.apache.ignite.internal.processors.query.calcite.hint.HintsConfig;
Expand Down Expand Up @@ -272,9 +271,6 @@ public class CalciteQueryProcessor extends GridProcessorAdapter implements Query
/** */
private final InjectResourcesService injectSvc;

/** */
private final AtomicBoolean udfQryWarned = new AtomicBoolean();

/** */
private volatile boolean started;

Expand Down Expand Up @@ -545,8 +541,6 @@ private <T> List<T> parseAndProcessQuery(
) throws IgniteSQLException {
ensureTransactionModeSupported(qryCtx);

checkUdfQuery();

SchemaPlus schema = schemaHolder.schema(schemaName);

assert schema != null : "Schema not found: " + schemaName;
Expand Down Expand Up @@ -704,29 +698,6 @@ private void ensureTransactionModeSupported(@Nullable QueryContext qryCtx) {
IgniteTxManager.ensureTransactionModeSupported(ctx.cache().context().tm().tx(ver).isolation());
}

/** Checks that query is initiated by UDF and print message to log if needed. */
private void checkUdfQuery() {
if (udfQryWarned.get())
return;

if (Thread.currentThread().getName().startsWith(AbstractQueryTaskExecutor.THREAD_PREFIX)
&& udfQryWarned.compareAndSet(false, true)) {
if (taskExecutor instanceof QueryBlockingTaskExecutor) {
log.info("Detected query initiated by user-defined function. " +
"In some circumstances, this can lead to thread pool starvation and deadlock. Ensure that " +
"the pool size is properly configured (property IgniteConfiguration.QueryThreadPoolSize). " +
"The pool size should be greater than the maximum number of concurrent queries initiated by UDFs.");
}
else {
log.warning("Detected query initiated by user-defined function. " +
"When a striped query task executor (the default configuration) is used, tasks for such queries " +
"can be assigned to the same thread as that held by the initial query, which can lead to a " +
"deadlock. To switch to a blocking tasks executor, set the following parameter: " +
"-DIGNITE_CALCITE_USE_QUERY_BLOCKING_TASK_EXECUTOR=true.");
}
}
}

/** */
private <T> T processQuery(
@Nullable QueryContext qryCtx,
Expand Down
Loading
Loading