Rust client: job cancellation#4828
Rust client: job cancellation#4828mladjan-gadzic wants to merge 2 commits intoarmadaproject:masterfrom
Conversation
Signed-off-by: Mladjan Gadzic <gadzic.mladjan@gmail.com>
6d1a824 to
3809d3a
Compare
Greptile SummaryThis PR adds job cancellation support to the Armada Rust client by implementing two new methods — Confidence Score: 5/5Safe to merge — no correctness, security, or API-contract issues found. All four changed files score 5/5. The two new client methods mirror the existing No files require special attention.
|
| Filename | Overview |
|---|---|
| client/rust/src/client.rs | Adds cancel_jobs and cancel_job_set methods that follow the same auth/timeout/tracing pattern as the existing submit method; no issues found. |
| client/rust/examples/cancel.rs | New example demonstrating single-job cancellation via cancel_jobs and job-set cancellation via cancel_job_set; correctly clones job_set_id only where needed. |
| client/rust/src/lib.rs | Adds CancellationResult, JobCancelRequest, JobSetCancelRequest, JobSetFilter, and JobState to the public re-export list; feature table updated correctly. |
| client/rust/Cargo.toml | Registers the new cancel example binary and updates the comment to mention it alongside submit and watch; no dependency changes. |
Sequence Diagram
sequenceDiagram
participant Caller
participant ArmadaClient
participant TokenProvider
participant SubmitClient (gRPC)
Note over Caller,SubmitClient (gRPC): cancel_jobs — cancel one or more jobs by ID
Caller->>ArmadaClient: cancel_jobs(JobCancelRequest { job_ids, queue, job_set_id, reason })
ArmadaClient->>TokenProvider: token()
TokenProvider-->>ArmadaClient: token (or "")
ArmadaClient->>ArmadaClient: build tonic::Request + set authorization header + apply_timeout
ArmadaClient->>SubmitClient (gRPC): cancel_jobs(req)
SubmitClient (gRPC)-->>ArmadaClient: CancellationResult { cancelled_ids }
ArmadaClient-->>Caller: Ok(CancellationResult)
Note over Caller,SubmitClient (gRPC): cancel_job_set — cancel all / filtered jobs in a set
Caller->>ArmadaClient: cancel_job_set(JobSetCancelRequest { queue, job_set_id, filter, reason })
ArmadaClient->>TokenProvider: token()
TokenProvider-->>ArmadaClient: token (or "")
ArmadaClient->>ArmadaClient: build tonic::Request + set authorization header + apply_timeout
ArmadaClient->>SubmitClient (gRPC): cancel_job_set(req)
SubmitClient (gRPC)-->>ArmadaClient: () (empty response)
ArmadaClient-->>Caller: Ok(())
Reviews (2): Last reviewed commit: "fix fmt" | Re-trigger Greptile
What type of PR is this?
Rust client support.
What this PR does / why we need it
Support for job cancellation.
Which issue(s) this PR fixes
Fixes #
Special notes for your reviewer