-
Notifications
You must be signed in to change notification settings - Fork 702
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
[flytepropeller][flyteagent] Set ListAgent Timeout to unblock propeller launch execution #6312
base: master
Are you sure you want to change the base?
[flytepropeller][flyteagent] Set ListAgent Timeout to unblock propeller launch execution #6312
Conversation
… routine Signed-off-by: Future-Outlier <[email protected]>
Code Review Agent Run #4d26d7Actionable Suggestions - 1
Review Details
|
Changelist by BitoThis pull request implements the following key changes.
|
@@ -419,7 +419,7 @@ func newAgentPlugin(agentService *core.AgentService) webapi.PluginEntry { | |||
cs: clientSet, | |||
registry: agentRegistry, | |||
} | |||
plugin.watchAgents(ctx, agentService) | |||
go plugin.watchAgents(ctx, agentService) |
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 watchAgents
function is now being called in a goroutine with go plugin.watchAgents(ctx, agentService)
. This is a good change as it prevents blocking the plugin initialization, but we should consider adding error handling for this goroutine. If the goroutine panics, it could silently fail without any notification.
Code suggestion
Check the AI-generated fix before applying
go plugin.watchAgents(ctx, agentService) | |
go func() { | |
defer func() { | |
if r := recover(); r != nil { | |
logger.Errorf(ctx, "watchAgents goroutine panicked: %v", r) | |
} | |
}() | |
plugin.watchAgents(ctx, agentService) | |
}() |
Code Review Run #4d26d7
Should Bito avoid suggestions like this for future reviews? (Manage Rules)
- Yes, avoid them
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #6312 +/- ##
==========================================
- Coverage 58.48% 57.89% -0.60%
==========================================
Files 937 774 -163
Lines 71091 57321 -13770
==========================================
- Hits 41580 33186 -8394
+ Misses 26359 21642 -4717
+ Partials 3152 2493 -659
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Signed-off-by: Future-Outlier <[email protected]>
Signed-off-by: Future-Outlier <[email protected]>
Signed-off-by: Future-Outlier <[email protected]>
Code Review Agent Run #c6f436Actionable Suggestions - 0Review Details
|
Tracking issue
#3936
Why are the changes needed?
We noticed that when propeller starts, it have to wait for the agent get the agent supported task type first, then it can launch execution.
However, sometimes the agent server won't response and we will have to wait for a long time, so if we give it timeout.
flyte/flyteplugins/go/tasks/plugins/webapi/agent/plugin.go
Lines 408 to 411 in 4df57ed
What changes were proposed in this pull request?
Set
ListAgents
request timeout to 3s.How was this patch tested?
single binary.
Setup process
Screenshots
Check all the applicable boxes
Related PRs
Docs link
Summary by Bito
This PR refines concurrency handling in the Flyte agent plugin by optimizing ListAgents timeout and adjusting goroutine usage. It removes an unnecessary go invocation and adds a goroutine for plugin.watchAgents, properly separating periodic execution from agent watching functionality. The changes also include multiple dependency upgrades, configuration updates, and documentation improvements to enhance performance and maintainability.Unit tests added: False
Estimated effort to review (1-5, lower is better): 4