Skip to content

Concurrent map panic in dev server under load #6567

@FelixHeinstadt

Description

@FelixHeinstadt

Concurrent map panic in dev server under load

Description

sst dev crashes with a concurrent map access panic when handling many Lambda invocations simultaneously.

Version

SST: 4.1.8

Steps to reproduce

  1. Run sst dev
  2. Trigger multiple concurrent Lambda invocations
  3. Dev server panics and crashes

Stack trace

(sst.log)

goroutine 1186548 [running]:
internal/runtime/maps.fatal({0x10659122b?, 0x0?})
	/opt/hostedtoolcache/go/1.25.7/x64/src/runtime/panic.go:1046 +0x20
github.com/sst/sst/v3/cmd/sst/mosaic/aws.function.func1({0x107e2a3d0, 0x141f41b8c30}, 0x141e83a7b80)
	/home/runner/work/sst/sst/cmd/sst/mosaic/aws/function.go:89 +0x19c
net/http.HandlerFunc.ServeHTTP(...)
net/http.(*ServeMux).ServeHTTP(...)
net/http.serverHandler.ServeHTTP(...)
net/http.(*conn).serve(...)
created by net/http.(*Server).Serve in goroutine 837

AI suggestion: "A sync.RWMutex or sync.Map around the map access in function.go:89 should fix this"

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions