Skip to content

Tell workers to kill operations the scheduler no longer has executing on them - #2693

Open
amankrx wants to merge 2 commits into
TraceMachina:mainfrom
amankrx:fix/scheduler-kill-operation
Open

Tell workers to kill operations the scheduler no longer has executing on them#2693
amankrx wants to merge 2 commits into
TraceMachina:mainfrom
amankrx:fix/scheduler-kill-operation

Conversation

@amankrx

@amankrx amankrx commented Aug 16, 2026

Copy link
Copy Markdown
Member

What and why

The scheduler never sent KillOperationRequest (only tests constructed one), so when an operation was finished server-side (client timeout, cancellation, execution deadline, requeue) the worker kept running it and holding its slot until the process ended on its own. This adds a periodic pass that asks the state manager whether each running operation is still executing on its worker and tells the worker to kill it if not. The worker's later report for a killed operation is not forwarded, so the kill's error cannot burn a retry on a re-queued copy.

How was this verified?

Unit tests only. is_executing_on_worker is table-tested across queued, assigned, requeued, reassigned, completed and unknown. A scheduler-level test drives a real client timeout while a single-slot worker holds the operation and checks that exactly one kill is sent, the worker's report returns Ok, and the slot frees for the next action; without the change, no kill is sent and the report fails with "already completed". A third test drops the worker channel and checks the worker is evicted when the kill cannot be delivered. Not yet run against a real deployment.

Risk

Behaviour change: an operation whose client vanished is now killed instead of running to completion and warming the AC. Every 5s each running operation costs one state-manager lookup, which is one Redis GET on store-backed deployments. New trait method on WorkerStateManager and WorkerScheduler. Wire format unchanged, the message already existed.


This change is Reviewable

@vercel

vercel Bot commented Aug 16, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
nativelink Ready Ready Preview Aug 20, 2026 3:57pm
nativelink-aidm Ready Ready Preview Aug 20, 2026 3:57pm

Request Review

@amankrx

amankrx commented Aug 20, 2026

Copy link
Copy Markdown
Member Author

/build-image nativelink-worker-init

@amankrx

amankrx commented Aug 20, 2026

Copy link
Copy Markdown
Member Author

/build-image nativelink

@github-actions

Copy link
Copy Markdown
Contributor

Image built and pushed!

ghcr.io/TraceMachina/nativelink-worker-init:2026-08-20-5d29f8266c836872a9bb278787063548ee1d1bd8

@github-actions

Copy link
Copy Markdown
Contributor

Image built and pushed!

ghcr.io/TraceMachina/nativelink:2026-08-20-5d29f8266c836872a9bb278787063548ee1d1bd8

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