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: remove error log when notification manager is already closed#18264

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
ethanndickson merged 3 commits intomainfromethan/remove-closed-check
Jun 6, 2025

Conversation

ethanndickson
Copy link
Member

@ethanndicksonethanndickson commentedJun 6, 2025
edited
Loading

Closescoder/internal#677

Resolves flakes such as:

$ go test -race -run "TestRunStopRace" github.com/coder/coder/v2/coderd/notifications -count=10000 -parallel $(nproc)--- FAIL: TestRunStopRace (0.00s)    t.go:106: 2025-06-06 02:44:39.348 [debu]  notifications-manager: notification manager started    t.go:106: 2025-06-06 02:44:39.348 [debu]  notifications-manager: graceful stop requested    t.go:106: 2025-06-06 02:44:39.348 [debu]  notifications-manager: notification manager stopped    t.go:115: 2025-06-06 02:44:39.348 [erro]  notifications-manager: notification manager stopped with error ...        error= manager already closed:                   github.com/coder/coder/v2/coderd/notifications.(*Manager).loop                       /home/coder/coder/coderd/notifications/manager.go:166         *** slogtest: log detected at level ERROR; TEST FAILURE ***--- FAIL: TestRunStopRace (0.00s)    t.go:106: 2025-06-06 02:44:41.632 [debu]  notifications-manager: notification manager started    t.go:106: 2025-06-06 02:44:41.632 [debu]  notifications-manager: graceful stop requested    t.go:106: 2025-06-06 02:44:41.632 [debu]  notifications-manager: notification manager stopped    t.go:115: 2025-06-06 02:44:41.633 [erro]  notifications-manager: notification manager stopped with error ...        error= manager already closed:                   github.com/coder/coder/v2/coderd/notifications.(*Manager).loop                       /home/coder/coder/coderd/notifications/manager.go:166         *** slogtest: log detected at level ERROR; TEST FAILURE ***FAILFAIL    github.com/coder/coder/v2/coderd/notifications  6.847sFAIL

These error logs are caused as a result of theManagerRun start operation being asynchronous. In the flaking test case we immediately callStop afterRun. It's possible forStop to be scheduled to completion before the goroutine spawned byRun callsloop and checksclosed. If this happens,loop returns an error and produces the error log.

We'll address this by replacing this specific error log with a warning log.

$ go test -run "TestRunStopRace" github.com/coder/coder/v2/coderd/notifications -count=10000 -parallel $(nproc)ok      github.com/coder/coder/v2/coderd/notifications  1.294s$ go test -race github.com/coder/coder/v2/coderd/notifications -count=100 -parallel $(nproc)ok      github.com/coder/coder/v2/coderd/notifications  26.525s

@ethanndicksonGraphite App
Copy link
MemberAuthor

ethanndickson commentedJun 6, 2025
edited
Loading

This stack of pull requests is managed byGraphite. Learn more aboutstacking.

@ethanndicksonethanndickson changed the base branch fromethan/send-ping-results tomainJune 6, 2025 03:53
@ethanndicksonethanndickson marked this pull request as ready for reviewJune 6, 2025 04:14
@ethanndicksonethanndicksonforce-pushed theethan/remove-closed-check branch fromb7e88f0 tof8f5e68CompareJune 6, 2025 05:41
@ethanndicksonethanndickson changed the titlefix: remove closed check when starting notification managerfix: remove error log when notification manager is closed on startupJun 6, 2025
@ethanndicksonethanndickson changed the titlefix: remove error log when notification manager is closed on startupfix: remove error log when notification manager is already closedJun 6, 2025
@ethanndicksonethanndickson merged commit533c6dc intomainJun 6, 2025
41 checks passed
@ethanndicksonethanndickson deleted the ethan/remove-closed-check branchJune 6, 2025 09:28
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsJun 6, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@mafredrimafredrimafredri approved these changes

Assignees

@ethanndicksonethanndickson

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

flake: TestRunStopRace
2 participants
@ethanndickson@mafredri

[8]ページ先頭

©2009-2025 Movatter.jp