Skip to content

cloudconfig.NewCloudConfig not thread safe - concurrent map writes #9

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

Open
JohanLindvall opened this issue Jun 2, 2025 · 1 comment · May be fixed by #10
Open

cloudconfig.NewCloudConfig not thread safe - concurrent map writes #9

JohanLindvall opened this issue Jun 2, 2025 · 1 comment · May be fixed by #10

Comments

@JohanLindvall
Copy link

JohanLindvall commented Jun 2, 2025

cloudconfig.NewCloudConfig appears to fail when used in Grafana alloy.

Stack trace of one goroutine:

fatal error: concurrent map writes

goroutine 541 [running]:
internal/runtime/maps.fatal({0xa92656e?, 0x58582d4?})
	/usr/local/go/src/runtime/panic.go:1058 +0x20
github.com/webdevops/go-common/azuresdk/cloudconfig.injectServiceConfig(...)
	/go/pkg/mod/github.com/webdevops/go-common@v0.0.0-20231022162947-a6adfb05a7e9/azuresdk/cloudconfig/cloudconfig.go:96
github.com/webdevops/go-common/azuresdk/cloudconfig.NewCloudConfig({0xa8a6e46, 0xa})
	/go/pkg/mod/github.com/webdevops/go-common@v0.0.0-20231022162947-a6adfb05a7e9/azuresdk/cloudconfig/cloudconfig.go:29 +0x3c8
github.com/grafana/alloy/internal/static/integrations/azure_exporter.(*Config).Validate(0x40046b2fc0)
	/src/alloy/internal/static/integrations/azure_exporter/config.go:150 +0x3f8
github.com/grafana/alloy/internal/static/integrations/azure_exporter.Exporter.MetricsHandler.func1({0xbe6e270, 0x40017ddce0}, 0x40015f7180)
	/src/alloy/internal/static/integrations/azure_exporter/azure_exporter.go:46 +0x24c
net/http.HandlerFunc.ServeHTTP(0x11b404c0?, {0xbe6e270?, 0x40017ddce0?}, 0x40021c74a5?)
	/usr/local/go/src/net/http/server.go:2294 +0x38
github.com/grafana/alloy/internal/service/http.(*Service).Run.(*Service).componentHandler.func11({0xbe6e270, 0x40017ddce0}, 0x40015f7180)
	/src/alloy/internal/service/http/http.go:437 +0x28c
net/http.HandlerFunc.ServeHTTP(0xbe5d0b0?, {0xbe6e270?, 0x40017ddce0?}, 0xa8fe136?)
	/usr/local/go/src/net/http/server.go:2294 +0x38
go.opentelemetry.io/contrib/instrumentation/github.com/gorilla/mux/otelmux.traceware.ServeHTTP({{0xa886509, 0x5}, {0xbdf0f20, 0x4001df5020}, {0xbe5fa90, 0x400148a700}, {0xbdbdc20, 0x4000c192c0}, 0xb0041d8, 0x0, ...}, ...)
	/go/pkg/mod/go.opentelemetry.io/contrib/instrumentation/github.com/gorilla/mux/otelmux@v0.45.0/mux.go:179 +0x900
github.com/gorilla/mux.(*Router).ServeHTTP(0x40014966c0, {0xbe5d0b0, 0x400277c0e0}, 0x40015f6dc0)
	/go/pkg/mod/github.com/gorilla/mux@v1.8.1/mux.go:212 +0x194
golang.org/x/net/http2/h2c.h2cHandler.ServeHTTP({{0xbdbe720?, 0x40014966c0?}, 0x40005d13b0?}, {0xbe5d0b0, 0x400277c0e0}, 0x40015f6dc0)
	/go/pkg/mod/golang.org/x/net@v0.37.0/http2/h2c/h2c.go:125 +0x4a8
net/http.serverHandler.ServeHTTP({0x40013341e0?}, {0xbe5d0b0?, 0x400277c0e0?}, 0x1?)
	/usr/local/go/src/net/http/server.go:3301 +0xbc
net/http.(*conn).serve(0x4002a3ec60, {0xbe90000, 0x40018690b0})
	/usr/local/go/src/net/http/server.go:2102 +0x52c
created by net/http.(*Server).Serve in goroutine 532
	/usr/local/go/src/net/http/server.go:3454 +0x3d8
@JohanLindvall
Copy link
Author

@mblaschke Please have a look at this PR

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 a pull request may close this issue.

1 participant