Skip to content

fix: Ensure coordinator is closed and freed in agent #4164

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

Merged
merged 2 commits into from
Sep 23, 2022

Conversation

mafredri
Copy link
Member

This PR (likely) fixes a leak that was seen in CI. (Also managed to reproduce it locally running tests in a loop.)

goleak: Errors on successful test run: found unexpected goroutines:
[Goroutine 2370 in state select, with nhooyr.io/websocket.(*Conn).timeoutLoop on top of the stack:
goroutine 2370 [select]:
nhooyr.io/websocket.(*Conn).timeoutLoop(0xc001216d00)
        /home/maf/go/pkg/mod/nhooyr.io/websocket@v1.8.7/conn_notjs.go:153 +0x23d
created by nhooyr.io/websocket.newConn
        /home/maf/go/pkg/mod/nhooyr.io/websocket@v1.8.7/conn_notjs.go:114 +0xc93
]
FAIL    github.com/coder/coder/coderd   5.528s
FAIL
  • fix: Close coordinator on context cancellation
  • fix: Refactor runCoordinator so that previous is closed/freed

@mafredri mafredri self-assigned this Sep 23, 2022
@mafredri mafredri requested a review from a team September 23, 2022 08:14
@mafredri mafredri force-pushed the mafredri/fix-websocket-leak-in-agent branch from 1a94ccf to 7e2ad50 Compare September 23, 2022 08:28
@mafredri mafredri merged commit 6b365f4 into main Sep 23, 2022
@mafredri mafredri deleted the mafredri/fix-websocket-leak-in-agent branch September 23, 2022 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants