feat: report capacity waits in function refresh job status (#5154)

An Enterprise Function refresh can spend time waiting for execution
workers. Applications polling `job.status()` currently see `running`
during that wait. Return `waiting_for_capacity` when the server reports
that phase for an active Function refresh. The next status request
reports `running` when execution resumes. Applications can use
`job.wait()` to wait through both states until completion.

Rust, Python and Node read the phase from the existing job description
response.

## Validation

Two HTTP regression tests exercise the public job handle. They cover the
wait, work resuming, completion after another wait, a stale phase at
completion, queued and paused refreshes, other job types, and servers
that omit the phase. The Rust CI remote job runs these tests.
This commit is contained in:
Yang Cen
2026-11-22 16:00:50 +08:00
committed by GitHub
parent 08ddcdb7d7
commit d9b49e8889
7 changed files with 104 additions and 24 deletions
+2 -2
View File
@@ -251,8 +251,8 @@ export class Job<T = void> {
}
/**
* The operation's current lifecycle state: "running", "finished", "failed",
* or "cancelled".
* The current status, usually "running", "finished", "failed", or "cancelled".
* A Function refresh waiting for execution workers reports "waiting_for_capacity".
*
* A point snapshot; unlike {@link Job.wait} it does not block or reject on a
* terminal failure state. Also refreshes the getters above.
+2 -2
View File
@@ -106,8 +106,8 @@ impl Job {
self.inner.execution_epoch()
}
/// The operation's current lifecycle state: "running", "finished",
/// "failed", or "cancelled".
/// The current status, usually "running", "finished", "failed", or "cancelled".
/// A Function refresh waiting for execution workers reports "waiting_for_capacity".
///
/// A point snapshot; unlike {@link Job.wait} it does not block or reject
/// on a terminal failure state. States a newer server reports that this