You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by "DanielLeens (via GitHub)" <gi...@apache.org> on 2026/09/05 16:20:12 UTC
[I] [Improve][Zeta] Budget promoted cooperative workers in TaskExecutionService [seatunnel]
DanielLeens opened a new issue, #12121:
URL: https://github.com/apache/seatunnel/issues/12121
## Description
This is a focused task for worker-side thread budgeting in `TaskExecutionService`. It is not a regression report.
Verified at `dev` commit `97d461bc0773399d632fd078735736ecd44f5f0b`:
- `TaskExecutionService.java:169-170` unbounded `LinkedBlockingDeque<TaskTracker> threadShareTaskQueue`; `:173-174` `executorService = newCachedThreadPool(new BlockingTaskThreadFactory())`; `:177-178` `RunBusWorkSupplier(executorService, threadShareTaskQueue)`.
- The cooperative worker requeues unfinished tasks at the queue tail. `TaskCallTimer.timeoutAct` (`TaskCallTimer.java:130-143`) marks the current bus-work exclusive to a slow task and submits a new bus-work via `runBusWorkSupplier.runNewBusWork(false)`, so each slow cooperative call adds one more thread.
Slot count bounds the number of task groups, not the number of threads or queue entries. No claim is made here about one thread per source split; the growth path is admitted engine tasks, callbacks, and promoted cooperative workers.
## Expected outcome
- A per-slot and per-job budget for promoted cooperative workers, with metrics for active threads, queue depth, and promotions.
- Any hard cap must still let source, coordinator, and sink tasks start and reach readiness; blocking the queue arbitrarily is not safe backpressure.
- Test: deploy many slow cooperative tasks and assert a bounded thread ceiling with no readiness deadlock.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Improve][Zeta] Budget promoted cooperative workers in TaskExecutionService [seatunnel]
Posted by "DanielLeens (via GitHub)" <gi...@apache.org>.
DanielLeens commented on issue #12121:
URL: https://github.com/apache/seatunnel/issues/12121#issuecomment-5663655219
Thanks for linking #12277. I rechecked the current `dev` path before making a scope decision: `TaskCallTimer#timeoutAct` calls `RunBusWorkSupplier.runNewBusWork(false)`, and the supplier uses a cached executor, so a timeout can indeed create another cooperative worker without a fixed admission budget. The PR is therefore on the right first boundary: an explicit budget decision wired into the actual promotion path, not a detached policy object.
Please keep both new limits opt-in with default `0` / unlimited. A finite default would change the behavior of existing deployments without an established safe capacity contract, so it should not be introduced in this first fix. The current status is still blocked: #12277's Build check is failing. Please repair that before treating the implementation as ready for review.
After CI is green, the review evidence needs to prove these invariants deterministically: (1) denied promotion does not create an extra worker yet a queue with its last serving worker still reaches readiness and completion; (2) global and per-job reservations are released on normal yield, failure, and cancellation, so another job can progress; and (3) leaving both limits at `0` preserves the existing unbounded path. Keep thread-pool log fields as diagnostic evidence only; a broader metrics contract can remain a later, separate discussion.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Improve][Zeta] Budget promoted cooperative workers in TaskExecutionService [seatunnel]
Posted by "CryoThrust (via GitHub)" <gi...@apache.org>.
CryoThrust commented on issue #12121:
URL: https://github.com/apache/seatunnel/issues/12121#issuecomment-5595002395
I reviewed the current `TaskExecutionService` path and did not find an active implementation PR for this issue. A useful first contract may separate three budgets rather than applying one global thread cap:
- a global ceiling for promoted cooperative workers;
- a per-job (or per task-group) ceiling so one noisy job cannot consume the pool;
- reserved capacity for readiness/coordination work, so an exhausted promotion budget cannot prevent source/sink startup or coordinator callbacks.
The admission decision should be explicit: when a timeout would promote work but the budget is exhausted, keep the tracker queued with a bounded retry/backoff and expose a reason (`BUDGET_EXHAUSTED`) rather than silently dropping it. The budget should be released when the promoted worker returns to the queue or the task group terminates, not merely when a timer fires.
For deterministic tests, I would inject the clock and promotion policy, then cover (1) one job exhausting its own budget while another job still progresses, (2) global budget exhaustion with reserved readiness capacity, (3) release/reuse after a worker yields, (4) cancellation while a promotion is pending, and (5) shutdown without stranded queue entries. Metrics can be added after the policy contract is accepted.
Would maintainers prefer the first PR to contain only a policy/budget object and unit tests, or should it also wire the decision into `TaskCallTimer` and `RunBusWorkSupplier`? I can prepare the smallest slice that matches the expected review boundary.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Improve][Zeta] Budget promoted cooperative workers in TaskExecutionService [seatunnel]
Posted by "Vivek1106-04 (via GitHub)" <gi...@apache.org>.
Vivek1106-04 commented on issue #12121:
URL: https://github.com/apache/seatunnel/issues/12121#issuecomment-5645331281
Opened #12277 for this.
Scope of that first PR, following the three budgets suggested above:
- `CooperativeWorkerBudget` carries a global limit and a per job limit, counts promotions and denials, and releases budget when the promoted worker finishes its task rather than when a timer fires.
- The decision is wired into `TaskCallTimer` and `RunBusWorkSupplier` rather than left as a standalone policy object, because the denial path is what needs review: a denied promotion keeps the tracker where it is and retries with a bounded backoff (reason `BUDGET_EXHAUSTED` in the log), and a replacement worker is still started when the denied worker is the last one serving the shared queue, so an exhausted budget cannot block readiness.
- Both limits default to 0 (unlimited), so the shipped behavior is unchanged until an operator opts in. Documented in the English and Chinese hybrid and separated deployment guides.
- Tests: a deterministic unit test for the policy (limits, per job rollback, release and reuse, concurrent acquire), and a service level test that deploys 8 slow cooperative tasks against a node with a global limit of 2 and a per job limit of 1, asserting a bounded worker count, denied promotions, continued progress of every task, normal completion, and budget release.
Metrics are currently the worker thread pool status log (`sharedCooperativeWorkers`, `promotedCooperativeWorkers`, `totalCooperativePromotions`, `deniedCooperativePromotions`); richer telemetry can follow once the policy contract is accepted. Happy to adjust the option names or the default if maintainers prefer a finite default instead of opt-in.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Improve][Zeta] Budget promoted cooperative workers in TaskExecutionService [seatunnel]
Posted by "SEZ9 (via GitHub)" <gi...@apache.org>.
SEZ9 commented on issue #12121:
URL: https://github.com/apache/seatunnel/issues/12121#issuecomment-5674237064
Thanks @CryoThrust for laying out the three-budget contract, and @Vivek1106-04 for turning it into a PR.
The scope of the first PR looks like the right boundary: wiring the admission decision into `TaskCallTimer` and `RunBusWorkSupplier` rather than shipping a detached policy object, since the denial path (tracker stays put, bounded backoff, `BUDGET_EXHAUSTED` in the log, replacement worker still started when the denied worker is the last one serving the shared queue) is exactly what needs review. Releasing budget when the promoted worker finishes rather than on a timer fire also matches what was proposed here.
A few concrete asks before I treat the implementation as ready for review:
1. Keep both limits opt-in with default `0` / unlimited. A finite default would change behavior for existing deployments without an established capacity contract, so please don't introduce one in this first fix.
2. Once CI on the PR is green, please confirm that here; I'll hold off on a detailed pass until then.
3. The tests should deterministically prove these invariants:
- a denied promotion does not create an extra worker, yet a queue whose last serving worker was denied still reaches readiness and completion;
- global and per-job reservations are released on normal yield, on failure, and on cancellation, so another job can progress afterwards (the per-job rollback and release/reuse cases you mention cover part of this — please add the failure and cancellation paths if they're not there yet);
- leaving both limits at `0` preserves the existing unbounded path.
4. Keep the thread-pool status log fields (`sharedCooperativeWorkers`, `promotedCooperativeWorkers`, `totalCooperativePromotions`, `deniedCooperativePromotions`) as diagnostic evidence only; a broader metrics contract can be a separate follow-up once the policy is accepted.
<!-- streview-comment:1064 -->
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org