Skip to content

feat: add WorkspaceUpdates tailnet RPC #14847

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 7 commits into from
Nov 1, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
remove mutex on sub close
  • Loading branch information
ethanndickson committed Nov 1, 2024
commit eafee6b5b00fa13fc5a792db6f2bc5abfa3f8520
2 changes: 0 additions & 2 deletions coderd/workspaceupdates.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,6 @@ func (s *sub) start(ctx context.Context) (err error) {
func (s *sub) Close() error {
s.cancelFn()

Copy link
Member Author

@ethanndickson ethanndickson Oct 23, 2024

Choose a reason for hiding this comment

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

cancelFn and psCancelFn aren't read from or written to once this Close function could ever be called, and the channel won't be read on after cancelFn cancels the context, so we don't need to acquire the mutex here. We'll also assume calling Close multiple times is undefined.

s.mu.Lock()
defer s.mu.Unlock()
if s.psCancelFn != nil {
s.psCancelFn()
}
Expand Down