Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: worker semaphore slot resolver #477

Merged
merged 25 commits into from
May 14, 2024
Merged

Conversation

grutt
Copy link
Contributor

@grutt grutt commented May 9, 2024

Description

Adds an interval based query to ensure semaphore values are accurate.

Depends on #476

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

What's Changed

  • add a query to update semaphores based on running step runs
  • add a task to the ticker to run this query every minute

@grutt grutt requested a review from abelanger5 May 9, 2024 18:21
Copy link

vercel bot commented May 9, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
hatchet-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 14, 2024 4:47pm

sr."workerId",
COUNT(*) AS runningRuns
FROM "StepRun" sr
WHERE sr."status" IN ('RUNNING', 'ASSIGNED') AND
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@abelanger5 can you confirm if an ASSIGNED task takes a slot?

)
FROM "Worker" w
WHERE ws."workerId" = w."id"
AND "slots" != COALESCE(w."maxRuns", 100) - COALESCE(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think this should be fine for now, its not guaranteed to update on every interval but it will update to the correct value

Base automatically changed from feat--slot-controls to main May 14, 2024 19:22
@abelanger5 abelanger5 merged commit a6845f2 into main May 14, 2024
19 checks passed
@abelanger5 abelanger5 deleted the feat--worker-semaphore-resolver branch May 14, 2024 19:23
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.

None yet

2 participants