-
Notifications
You must be signed in to change notification settings - Fork 219
refactor: add healthy builder helper, safe cluster cancel, and preallocate slice #1667
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
refactor: add healthy builder helper, safe cluster cancel, and preallocate slice #1667
Conversation
…tance health checks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| if !isHealthyBuilder(instance) { | ||
| return nil, ErrTemplateBuilderNotFound |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Allow draining builders for node-specific lookups
GetTemplateBuilderByNodeID now rejects any builder that is not strictly Healthy, which excludes the Draining state. However draining is still treated as healthy for service traffic (see packages/client-proxy/internal/edge/handlers/healthy.go), and node-specific operations rely on this lookup (e.g. temporary build logs in template-manager/logs.go, and build client selection in template_manager.go). When a node enters draining during shutdown, these paths will now fail or fall back to another node even though the draining builder is still serving in-flight builds, causing missing logs or failed build operations for those builds.
Useful? React with 👍 / 👎.
jakubno
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove the part with cancel as it isn't really needed
| if c.cancel != nil { | ||
| c.cancel() // stop startSync goroutine | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The startSync goroutine is stopped by calling
c.synchronization.Close()
| if instance.GetStatus() == infogrpc.ServiceInfoStatus_Unhealthy || !instance.IsBuilder() { | ||
| return nil, ErrTemplateBuilderNotFound | ||
| } | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please return the deleted newlines
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
jakubno
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Return newlines
jakubno
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Last small NIT
|
Thanks, @yaninyzwitty, for your contribution! |
isHealthyBuilderhelper to centralize status checks