Skip to content

Fix concurrent map crash in UptimePerService#132

Merged
dbaseqp merged 1 commit intodbaseqp:mainfrom
tire-fire:fix/graphs-concurrent-map
Feb 16, 2026
Merged

Fix concurrent map crash in UptimePerService#132
dbaseqp merged 1 commit intodbaseqp:mainfrom
tire-fire:fix/graphs-concurrent-map

Conversation

@tire-fire
Copy link
Contributor

fatal error: concurrent map iteration and map write

goroutine 366332 [running]:
internal/runtime/maps.fatal({0x108cc23?, 0x47bc2f?})
/usr/local/go/src/runtime/panic.go:1046 +0x18
internal/runtime/maps.(*Iter).Next(0xc000b09640?)
/usr/local/go/src/internal/runtime/maps/table.go:792 +0x86
quotient/www/api.GetUptimeStatus({0x121bb10, 0xc0004fc5a0}, 0xc000210b40)
/src/www/api/graphs.go:198 +0x91b
net/http.HandlerFunc.ServeHTTP(...)
/usr/local/go/src/net/http/server.go:2322
quotient/www/middleware.Logging.func1({0x121bb10, 0xc0004fc5a0}, 0xc000210b40)
/src/www/middleware/logging.go:25 +0x2b8
net/http.HandlerFunc.ServeHTTP(...)
/usr/local/go/src/net/http/server.go:2322
quotient/www/middleware.Cors.func1({0x121bb10, 0xc0004fc5a0}, 0xc000210b40)
/src/www/middleware/cors.go:18 +0x272
quotient/www.(*Router).Start.Authentication.func2.1({0x121bb10, 0xc0004fc5a0}, 0xc000210a00)
/src/www/middleware/authentication.go:41 +0x31e
net/http.HandlerFunc.ServeHTTP(0xc00045aa80?, {0x121bb10?, 0xc0004fc5a0?}, 0xec4500?)
/usr/local/go/src/net/http/server.go:2322 +0x29
net/http.(*ServeMux).ServeHTTP(0x12?, {0x121bb10, 0xc0004fc5a0}, 0xc000210a00)
/usr/local/go/src/net/http/server.go:2861 +0x1c7

The engine goroutine was writing to se.UptimePerService in processCollectedResults while an HTTP handler was iterating the same map in GetUptimeStatus at graphs.go:198. Go's runtime detected this and killed the process.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@dbaseqp dbaseqp merged commit 0cefbcf into dbaseqp:main Feb 16, 2026
4 checks passed
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