Skip to content

feat: add poll_now_notify to poll_loop and on_work_available callback#1893

Open
Jeadie wants to merge 2 commits into
apache:mainfrom
spiceai:upstream/poll-now-notify-on-work-available
Open

feat: add poll_now_notify to poll_loop and on_work_available callback#1893
Jeadie wants to merge 2 commits into
apache:mainfrom
spiceai:upstream/poll-now-notify-on-work-available

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 two related hooks for push-style executor scheduling:

  • An optional poll_now_notify: Option<Arc<Notify>> parameter on the executor poll_loop. When provided, the idle wait becomes a tokio::select! over the poll interval and the notify, so the scheduler can wake an idle executor immediately instead of waiting for the next poll tick. None preserves the existing timer-only behavior.
  • An OnWorkAvailableFn callback on SchedulerConfig (on_work_available), invoked by the query stage scheduler when new work becomes available (after JobSubmitted and when new stages become runnable).

Ported from spiceai#12

Jeadie added 2 commits June 23, 2026 13:58
Adds an optional poll_now_notify: Option<Arc<Notify>> parameter to the
executor poll_loop so the scheduler can wake an idle executor immediately
instead of waiting for the next poll interval. The idle wait becomes a
tokio::select! over the poll interval and the notify.

Adds an OnWorkAvailableFn callback to SchedulerConfig, invoked from the
query stage scheduler when new work becomes available (after JobSubmitted
and when new stages become runnable).

Ported from #12 for upstreaming.
@Jeadie Jeadie changed the title Upstream/poll now notify on work available feat: add poll_now_notify to poll_loop and on_work_available callback Jun 23, 2026
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