Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix(agent/agentcontainers): remove unneeded default branch#20511

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

Merged
DanielleMaywood merged 1 commit intomainfromdanielle/fix/agentcontainers-flake
Oct 28, 2025

Conversation

@DanielleMaywood
Copy link
Contributor

Closescoder/internal#769

According to thetime.NewTicker documentation1 (which is used under the hood byhttps://github.com/coder/quartz) it will automatically adjust the time interval to make up for slow receivers. This means we should be safe to drop the default branch.

NewTicker returns a new Ticker containing a channel that will send the current time on the channel after each tick. The period of the ticks is specified by the duration argument. The ticker will adjust the time interval or drop ticks to make up for slow receivers. The duration d must be greater than zero; if not, NewTicker will panic.

Footnotes

  1. https://pkg.go.dev/time#Ticker

Closescoder/internal#769According to the `time.NewTicker` documentation [^1] (which is used under thehood byhttps://github.com/coder/quartz) it will automatically adjustthe time interval to make up for slow receivers. This means we should besafe to drop the default branch.> NewTicker returns a new Ticker containing a channel that will send the current time on the channel after each tick. The period of the ticks is specified by the duration argument. The ticker will adjust the time interval or drop ticks to make up for slow receivers. The duration d must be greater than zero; if not, NewTicker will panic.[^1]:https://pkg.go.dev/time#Ticker
@DanielleMaywoodDanielleMaywood marked this pull request as ready for reviewOctober 28, 2025 09:53
@DanielleMaywoodDanielleMaywood requested review fromjohnstcn andmafredri and removed request formafredriOctober 28, 2025 09:53
Copy link
Member

@johnstcnjohnstcn left a comment

Choose a reason for hiding this comment

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

LGTM but will defer to@mafredri

@mafredri
Copy link
Member

mafredri commentedOct 28, 2025
edited
Loading

@DanielleMaywooddoesn't the quartz docs only apply to testing? I.e. for production it uses real implementations. Re-read what you wrote, misinterpreted it the first time.

Please re-check the Go docs for the Go version we use, IIRC the implementation changed recently.

IIRC the reason for the default case is not slow receivers, it's to not queue up a periodic update if a one is already running. Allowing it should be fine though, perhaps just a bit wasteful.

By what mechanism are you proposing that removing the default case fixes the flake?

@DanielleMaywood
Copy link
ContributorAuthor

@mafredri Docs for version of go we use says the same thinghttps://pkg.go.dev/time@go1.24.2#NewTicker

I've tested locally and this fix does appear to stop the flake happening for me. As for why, I'massuming in the test scenario there is a race on theupdateTrigger channel being ready for reading.

My understanding could be entirely wrong though (although I haven't managed to get the error to occur again with the change).

@mafredri
Copy link
Member

mafredri commentedOct 28, 2025
edited
Loading

IMO a better option would be to makeupdateTrigger buffered (1), because there also exists a race between the running the initial tick and the code arriving atfor loop that readsupdateTrigger.

On second thought, I overlooked one thing with dropping default so that approach is not any worse than buffering the trigger.

@DanielleMaywoodDanielleMaywood merged commite4e4669 intomainOct 28, 2025
34 checks passed
@DanielleMaywoodDanielleMaywood deleted the danielle/fix/agentcontainers-flake branchOctober 28, 2025 12:16
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsOct 28, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

@mafredrimafredrimafredri approved these changes

@johnstcnjohnstcnjohnstcn approved these changes

Assignees

@DanielleMaywoodDanielleMaywood

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

flake:TestAPI/NoUpdaterLoopLogspam

4 participants

@DanielleMaywood@mafredri@johnstcn

[8]ページ先頭

©2009-2025 Movatter.jp