feat(coordinator): free slots are shared between clients #340
Labels
Clear labels
accessibility
all-platforms
area:agents
area:ai
area:chain
area:ci
area:client
area:daemon
area:p2p
area:project
area:protocol
area:runtime
area:storage
bug
chore
community
dependencies
discussion
discussion/Announcements
discussion/General
discussion/Ideas
discussion/Q&A
discussion/Show and tell
discussion/answered
documentation
duplicate
enhancement
good first issue
help wanted
i18n
infra
invalid
needs:decision
needs:hardware
paired
question
research
security
status:in-review
test
testing
tracking
wontfix
Barrier affecting people with disabilities
Run every platform's packaging and checks on this pull request, not only the three main ones
MCP server, skill, and thinking on the pool
Planner and model providers
Blockchain, SISY, verification
Continuous integration and build workflows
Desktop and web clients
sisyphusd coordinator, worker, scheduler
libp2p hosts, relays, discovery, connections between nodes
Project planning, roadmap, and governance
Protobuf schemas and RPC contracts
Workload execution and environments
Content-addressed storage, IPFS, Kubo, Cluster, S3, names, pinning
Something isn't working
Repository health, templates, Discussions, contributor experience
Updates to actions, Go modules or npm packages
Migrated from GitHub Discussions
GitHub Discussions category: Announcements
GitHub Discussions category: General
GitHub Discussions category: Ideas
GitHub Discussions category: Q&A
GitHub Discussions category: Show and tell
Q&A discussion with an accepted answer
Improvements or additions to documentation
This issue or pull request already exists
New feature or request
Good for newcomers
Extra attention is needed
Translations and right-to-left layouts
Build, CI, releases
This doesn't seem right
Waits on a decision from both owners
Waits on a machine we do not have yet
Built together by both maintainers, with co-authored commits
Further information is requested
Needs investigation or a design decision
Sealing, keys, access control, tokens, the security model
Built and in an open pull request; closes when it merges
Tests, test harnesses and the rehearsal
Roadmap and meta issues
This will not be worked on
type
Feature
A request, idea, or new functionality (GitHub issue type)
type
Task
A specific piece of work (GitHub issue type)
Milestone
No items
No Milestone
Beyond V0: open network and chain
Projects
Clear projects
No projects
Sisyphus roadmap
Done
No Assignees
rvnminers-A-and-N
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: Sisyphus/Sisyphus#340
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
The second part of the D335 budget (#335): fair slot sharing.
A free slot used to go to the oldest job's next task. So one client's job of many tasks, submitted first, held every slot until it was done, while another client's work waited. Now:
Each job's waiting tasks are listed once per pass, not once per slot handed out, so a job of thousands of tasks costs no more to schedule.
Tests:
TestFreeSlotsAreSharedBetweenClients.make coverpasses at 100%.Docs: the daemon README,
docs/security-model.mdand the abuse note.@excho0 a review would be welcome. This touches only
scheduleLocked, notsubmit, so it doesn't overlap the #338 follow-up.I found a gap against the fair-slot-sharing direction agreed in Discussion #335.
@@ -1505,2 +1510,3 @@}if c.replicated(job) {next := &waitingJob{job: job, copies: c.replicated(job)}if next.copies {Verified jobs bypass the new per-submitter queue: the earlier
c.replicated(job)branch callscopiesLocked(job)and continues. With two free worker slots, the oldest verified client's first task can take both copies while another submitter's work waits, which is the same slot monopolization this change is meant to prevent. The agreement in #335 says each free slot goes to the submitter with the fewest tasks running. Please include each outstanding verified copy in that fair selection (counting each occupied worker slot consistently) and add a competing-client regression, or explicitly revisit the exception in #335 and document it. As written, the core fairness promise does not hold for verified jobs.@excho0 Agreed: that broke the promise in #335.
8540ea5fixes it rather than documenting it as an exception.What changed in the scheduler:
copiesLockedbecamecopyLocked, which hands out a single copy, so the queue drives every handout.Regression:
TestCopiesOfVerifiedTasksAreSharedBetweenClients.-race -count=3alongside the existing verify tests.The README now says copies are shared out the same way.
make coveris next.The updated scheduler now routes verified-task copies through the same per-submitter fair queue, and the regression covers the previously unfair slot order. All required checks are green. This resolves my earlier review request and matches the direction agreed in Discussion #335.