- Notifications
You must be signed in to change notification settings - Fork905
feat(agent/agentcontainers): update containers periodically#17972
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
84e7fb1
to25ead7b
Compare This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
This change introduces a significant refactor to the agentcontainers APIand enabled periodic updates of Docker containers rather than on-demand.Consequently this change also allows us to move away from using alocking channel and replace it with a mutex, which simplifies usage.Additionally a previous oversight was fixed, and testing added, to cleardevcontainer running/dirty status when the container has been removed.Updates#16424Updatescoder/internal#621
agent/agentcontainers/api.go Outdated
defer func() { sema <- struct{}{} }() | ||
return api.updateContainers(api.ctx) |
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.
Would it make sense instead to just return early fromdoUpdate()
if we're not able to read fromsema
? Queueing multiple updates seems like it could cause increased memory usage over time, and I'm not sure what value we get from running it right again after one instance has just completed.
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.
If we did that, we can't wait for it to complete in therefreshContainers
function. I'll see if there's any point in keeping a refresh method around after I refactor the recreate endpoint.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
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.
looks good to me 😄
d6c14f3
intomainUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
This change introduces a significant refactor to the agentcontainers API
and enables periodic updates of Docker containers rather than on-demand.
Consequently this change also allows us to move away from using a
locking channel and replace it with a mutex, which simplifies usage.
Additionally a previous oversight was fixed, and testing added, to clear
devcontainer running/dirty status when the container has been removed.
Updates#16424
Updatescoder/internal#621