Files
next.orly.dev/pkg/database
woikos 4522081506
Some checks are pending
Go / build-and-release (push) Waiting to run
Fix memory exhaustion from concurrent Badger queries (v0.52.17)
- Add query semaphore limiting concurrent database queries to 3
- Reuse single iterator in FetchEventsBySerials instead of one per serial
- Disable expensive e-tag fallback lookup in deletion processing
- Add empty ID validation in access tracker loop
- Reduce log spam from GetSerialById empty ID errors

These changes reduce memory usage from ~5GB to ~150MB under load by
limiting concurrent Badger iterators which consume significant memory.

Files modified:
- pkg/database/database.go: Add query semaphore with acquire/release
- pkg/database/fetch-events-by-serials.go: Reuse iterator for sev lookups
- pkg/database/query-events.go: Add semaphore, disable e-tag fallback
- pkg/database/get-serial-by-id.go: Don't log empty ID errors
- app/handle-req.go: Validate event ID before GetSerialById
- pkg/version/version: Bump to v0.52.17

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-21 17:23:30 +01:00
..
2025-11-23 08:15:06 +00:00
2025-11-23 08:15:06 +00:00