Skip to content

fix(scheduler): default no-executors grace to executor timeout (>= heartbeat) - #2279

Merged
milenkovicm merged 1 commit into
apache:mainfrom
akshaychitneni:fix/grace-period-covers-heartbeat
Aug 12, 2026
Merged

fix(scheduler): default no-executors grace to executor timeout (>= heartbeat)#2279
milenkovicm merged 1 commit into
apache:mainfrom
akshaychitneni:fix/grace-period-covers-heartbeat

Conversation

@akshaychitneni

@akshaychitneni akshaychitneni commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Which issue does this PR close?
Follow-up to #2029 / #2212, addressing the timeout interaction surfaced by #2240 (#2240 (comment))

Rationale for this change
The empty-cluster grace timer defaulted to 30s, but the executor heartbeat interval defaults to 60s. Since #2240 routes task-launch-failure removals through the same ExecutorLost path (aggressive removal that also drops the heartbeat), a healthy executor removed by a transient blip re-registers only on its next heartbeat (~≤60s) — which the 30s timer could beat,
spuriously failing the job.

What changes are included in this PR?

  • no_executors_grace_period_seconds now defaults to executor_timeout_seconds (guaranteed longer than the heartbeat interval; the scheduler can't read the executor's heartbeat setting directly).
  • CLI arg is Option, resolving to executor_timeout_seconds when unset; SchedulerConfig::Default matches.
  • Removal stays immediate (fast rescheduling); only the fail decision waits, and the timer's re-check still cancels the failure if the executor re-registers. Explicit values (incl. 0 = fail-fast) honored.
  • Adds config tests (default resolution + grace >= executor_timeout invariant).

Are there user-facing changes?
Yes — the default no-executors grace period changes from 30s to executor_timeout_seconds (180s by default); --no-executors-grace-period-seconds is now optional and defaults to that.

Comment on lines +402 to +404
// Defaults to `executor_timeout_seconds` so the grace is always >=
// the executor heartbeat interval (see the field doc).
no_executors_grace_period_seconds: 180,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be 180 by default, if the executor_heartbeat_interval_seconds is 60 secs by default?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. 180 is the default executor_timeout_seconds (the liveness window) giving 3× margin for a transiently-removed executor to re-register before its jobs fail

@milenkovicm milenkovicm left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @akshaychitneni this makes sense, one minor comment, and a question if we can add validation method now when we have dependencies between configuration values

Comment thread ballista/scheduler/src/config.rs
@akshaychitneni
akshaychitneni force-pushed the fix/grace-period-covers-heartbeat branch from ffb6901 to e57e504 Compare August 11, 2026 18:04
@akshaychitneni

Copy link
Copy Markdown
Contributor Author

Thanks @akshaychitneni this makes sense, one minor comment, and a question if we can add validation method now when we have dependencies between configuration values

Thanks. Added SchedulerConfig::validate(), called from start_server. It warns when no_executors_grace_period_seconds (nonzero) is below executor_timeout_seconds, and when the timeout isn't greater than the expire interval

…artbeat)

The 30s grace could fail jobs before an executor removed by a transient
launch failure (apache#2240) re-registers on its next heartbeat (~60s). Default
no_executors_grace_period_seconds to executor_timeout_seconds instead, which
is guaranteed longer than the heartbeat interval. Explicit values (incl. 0)
still honored. Adds config tests.
@akshaychitneni
akshaychitneni force-pushed the fix/grace-period-covers-heartbeat branch from e57e504 to 21dc724 Compare August 11, 2026 20:53

@milenkovicm milenkovicm left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@milenkovicm
milenkovicm merged commit 5e54503 into apache:main Aug 12, 2026
23 checks passed
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.

3 participants