<@U0A71G31CDV> If for some reason an async task ex...
# questions-and-troubleshooting
s
@Rocky If for some reason an async task execution consistently last more than its scheduled interval, do pending task invocations pile up without bounds ? Are they coalesced ? Example
Copy code
SUBMIT TASK my_periodic_task
SCHEDULE EVERY(INTERVAL 30 SECOND)
AS ........... task code .....
r
Short answer: they can't pile up unbounded, but there's no coalescing for plain
SUBMIT TASK
ETL tasks — excess triggers get rejected, not merged. What the docs actually state: Bounded queue, not unbounded growth •
task_runs_queue_length
(default
500
): "Limits the maximum number of pending TaskRun items kept in the pending queue.
TaskRunManager
checks the current pending count and rejects new submissions when valid pending TaskRun count is greater than or equal to
task_runs_queue_length
." The SUBMIT TASK doc phrases it as: "If the number exceeds the default value, the incoming tasks will be suspended." • So with your 30s interval, if each run takes longer than 30s, the pending backlog grows only until it hits this cap, then new TaskRuns are refused. Why a backlog forms at all •
task_runs_concurrency
(default
4
) is a global cap on concurrently running TaskRuns: "`TaskRunScheduler` stops scheduling new runs when current running count is greater than or equal to
task_runs_concurrency
." Note it's global, not per task — so other tasks/async MV refreshes share the same 4 slots, which makes the PENDING queue fill up even faster. •
max_task_runs_threads_num
(default
512
) is the executor pool upper bound; the docs note reducing it "can cause task-run backlog and higher latency." Coalescing? Only for async materialized view refresh TaskRuns, not for general ETL tasks. From `INFORMATION_SCHEMA.task_runs`: "From v3.1.12, a new state
MERGED
is added especially for materialized view refresh tasks. When a new refresh task is submitted and the old task is still in the pending queue, these tasks will be merged and their priority level will be maintained." Nothing in the docs suggests that applies to
SUBMIT TASK ... INSERT/CTAS/CACHE SELECT
. What I can't confirm from the docs I didn't find explicit documentation on whether each 30-second tick unconditionally creates a TaskRun while the previous one is still RUNNING, or whether the scheduler skips ticks for an over-running task. So I can't say definitively which of "one PENDING entry per tick" vs "some skip logic" is true for your version. To check empirically on your cluster: •
SELECT STATE, COUNT(*) FROM information_schema.task_runs WHERE task_name='my_periodic_task' GROUP BY STATE;
— if PENDING climbs steadily, ticks are creating runs. •
SELECT inspect_task_runs();
— shows the FE's pending/running TaskRun queues directly. • Also compare
CREATE_TIME
vs
PROCESS_TIME
/
FINISH_TIME
gaps to measure queue wait. Practical mitigation: raise the interval (minimum is
task_min_schedule_interval_s
, default 10s), raise
task_runs_concurrency
if the cluster can take the parallelism, or
ALTER TASK ... SUSPEND
/
RESUME
(v4.1+) to stop scheduling. If you need a definitive statement about tick behavior, ask in the StarRocks community Slack or open an issue on GitHub. References • sql-reference/sql-statements/loading_unloading/ETL/ALTER_TASK.md • sql-reference/sql-statements/loading_unloading/pipe/SUSPEND_or_RESUME_PIPE.md • sql-reference/sql-statements/loading_unloading/ETL/SUBMIT_TASK.md • sql-reference/sql-statements/loading_unloading/routine_load/ALTER_ROUTINE_LOAD.md