Skip to content

fix: Fix race condition on channel#28

Open
hermanschaaf wants to merge 1 commit intovnteamopen:mainfrom
cloudquery:fix-race
Open

fix: Fix race condition on channel#28
hermanschaaf wants to merge 1 commit intovnteamopen:mainfrom
cloudquery:fix-race

Conversation

@hermanschaaf
Copy link

This should fix two issues:

panic: close of closed channel

goroutine 1337 [running]:
github.com/vnteamopen/godebouncer.(*Debouncer).invokeTriggeredFunc.func1()
	/home/runner/go/pkg/mod/github.com/vnteamopen/godebouncer@v1.1.1-0.20230626172639-4b59d27e1b8c/debouncer.go:124 +0x85
created by time.goFunc
	/opt/hostedtoolcache/go/1.21.5/x64/src/time/sleep.go:176 +0x45

and a data race, as can be seen in the CI build here.

kodiakhq bot pushed a commit to cloudquery/cloudquery that referenced this pull request Jul 24, 2025
#### Summary

Should fix the data race in #21116. Instead of using the `Done()` channel we can call the debounced function one last time.

The data race is a known issue in the package, see vnteamopen/godebouncer#28
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