Skip to content

feat: allow an external semaphore for executor task concurrency#1892

Open
Jeadie wants to merge 2 commits into
apache:mainfrom
spiceai:upstream/external-semaphore-busy-state
Open

feat: allow an external semaphore for executor task concurrency#1892
Jeadie wants to merge 2 commits into
apache:mainfrom
spiceai:upstream/external-semaphore-busy-state

Conversation

@Jeadie

@Jeadie Jeadie commented Jun 23, 2026

Copy link
Copy Markdown

Which issue does this PR close?

None Closes #. Suggested by @milenkovicm that we should upstream our changes (see comment).

Rationale for this change

Useful in spiceai/datafusion-ballista for production features.

What changes are included in this PR?

Adds an optional available_task_slots: Option<Arc<Semaphore>> parameter to the executor poll_loop. When provided, the caller supplies the semaphore that bounds concurrent task execution; when None, the loop creates one internally sized to the executor's task slots (unchanged behavior).

Enables:

  • sharing the concurrency semaphore across poll loops connected to different schedulers,
  • observing executor busy state externally via available_permits().

Ported from spiceai#14.

Jeadie added 2 commits June 23, 2026 14:03
Adds an optional available_task_slots: Option<Arc<Semaphore>> parameter to
the executor poll_loop. When provided, the caller supplies the semaphore
that bounds concurrent task execution; this enables sharing it across poll
loops connected to different schedulers and observing executor busy state
via available_permits(). When None, the loop creates one internally sized
to the executor's task slots (unchanged behavior).

Ported from #14 for upstreaming. Note: layers
on the poll_loop signature; if landed after #12 (poll_now_notify) it needs
a trivial rebase to add both parameters.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant