Skip to content

ateapi: describe no_capacity without "free worker" - #2137

Merged
Julian Gutierrez Oschmann (juli4n) merged 1 commit into
agent-substrate:mainfrom
JeffLuoo:fix/issue-2128-free-worker-text
Oct 6, 2026
Merged

Julian Gutierrez Oschmann (juli4n) merged 1 commit into
agent-substrate:mainfrom
JeffLuoo:fix/issue-2128-free-worker-text

Conversation

@JeffLuoo

@JeffLuoo Jeff Luo (JeffLuoo) commented Oct 2, 2026 •

Copy link
Copy Markdown
Collaborator

A worker can hold more than one actor, so "free worker" does not describe the capacity condition correctly. The scheduler returns ErrNoCapacity when no worker that meets the constraints has room. The cause can be full workers, or no worker that meets the constraints at all.

Fixes #2128

It's a good idea to open an issue first for discussion.

  • Tests pass
  • Appropriate changes to documentation are included in the PR

// ErrNoCapacity is returned by Schedule when no worker that meets the
// constraints has room. The cause can be full workers, or no worker that meets
// the constraints at all.
var ErrNoCapacity = errors.New("no worker that meets the constraints has room")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The word "room" sound a bit odd to me. Maybe "could not find worker that meets the actor requirements" or similar?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Thanks for looking. "Room" is the scheduler's own term

// HasRoom reports whether what the worker has left admits one more actor of
// this size. A dimension the worker does not report is unconstrained, so
// placement is never blocked by missing data.
//
// A worker whose recorded capacity or allocation will not parse is treated as
// having no room: it is the only answer that cannot overcommit a worker whose
// true occupancy is unreadable.
func (s *scheduler) HasRoom(worker *ateapipb.Worker, constraints Constraints) bool {
want, err := resources.ParseQuantities(constraints.Limits)
if err != nil {

I would like the message to match that, so that one condition has one name.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Interesting. The code is evolving so far, sorry for the misleading comment!

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I'm not sure if this is the terminology we want either but we can bulk update it and I think this PR is strictly better than before

A worker can hold more than one actor, so "free worker" does not describe the capacity condition correctly. The scheduler returns ErrNoCapacity when no worker that meets the constraints has room. The cause can be full workers, or no worker that meets the constraints at all.

The text of ErrNoCapacity, the comments on Schedule, and the ResourceExhausted message from AssignWorker now describe that condition. The new message is "no worker has room for the actor". The e2e checks that match the message, the tests, and the comments and docs that quote it use the new text. The CI failure analysis script matches both the old and the new message, so it still classifies older logs.

A client that matches the old message text must change to the new text. The gRPC code does not change, so a client that checks ResourceExhausted is not affected.
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to no response for status checks Oct 5, 2026
Merged via the queue into agent-substrate:main with commit ef4ce5d Oct 6, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The scheduler text and ErrNoCapacity still say "free worker"

5 participants