feat(coordinator): a coordinator can limit how many unfinished jobs each client has #336

Merged
admin merged 1 commits from max-jobs-per-client into dev 2026-10-16 21:56:27 +00:00
Owner

The first of the per-client limits proposed in discussion #335: the smallest one, which doesn't depend on any of the open questions there.

Any admitted client can submit jobs without end, filling a coordinator's memory and journal for everyone else.

  • New coordinator flag --max-jobs-per-client N, off by default.
  • A client with N unfinished jobs is refused another, with RESOURCE_EXHAUSTED and a message saying how many it has, until one is over.
  • Clients are counted by Job.Submitter, the node ID of the key they submitted with.
  • The coordinator's own jobs (local API, planner, empty submitter) aren't counted. Neither are the steps of a job, apart from the job itself.
  • It bounds jobs, not tasks; the docs say so. Whether it should also count tasks is one of the questions in #335. If the answer is yes, I'll add that to this flag or as a second one.

Docs: daemon README, security model, and the abuse note's resource row.

Tests: a third job from a client at a limit of two is refused; another client, the node itself and a step are not; and the client may submit again once one of its jobs is cancelled. Run under -race. make cover at 100%.

The first of the per-client limits proposed in [discussion #335](https://git.echelonts.net/Sisyphus/Sisyphus/issues/335): the smallest one, which doesn't depend on any of the open questions there. Any admitted client can submit jobs without end, filling a coordinator's memory and journal for everyone else. - New coordinator flag `--max-jobs-per-client N`, off by default. - A client with `N` unfinished jobs is refused another, with `RESOURCE_EXHAUSTED` and a message saying how many it has, until one is over. - Clients are counted by `Job.Submitter`, the node ID of the key they submitted with. - The coordinator's own jobs (local API, planner, empty submitter) aren't counted. Neither are the steps of a job, apart from the job itself. - It bounds jobs, not tasks; the docs say so. Whether it should also count tasks is one of the questions in #335. If the answer is yes, I'll add that to this flag or as a second one. Docs: daemon README, security model, and the abuse note's resource row. Tests: a third job from a client at a limit of two is refused; another client, the node itself and a step are not; and the client may submit again once one of its jobs is cancelled. Run under `-race`. `make cover` at 100%.
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Sisyphus/Sisyphus#336