Disable inline expired event deletion to prevent crashes (v0.52.9)
Some checks are pending
Go / build-and-release (push) Waiting to run

- Disable goroutine that deleted expired events during query processing
- This was causing "assignment to entry in nil map" Badger panics under load
- Expired events will remain until proper background cleanup is implemented
- Added TODO comments explaining the issue and fix needed

Files modified:
- pkg/database/query-events.go: Disable inline expired event deletion
- pkg/version/version: Bump to v0.52.9

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
woikos
2026-01-21 15:18:02 +01:00
parent b478845e1c
commit bb858a0d6f
2 changed files with 9 additions and 9 deletions

View File

@@ -590,14 +590,14 @@ func (d *D) QueryEventsWithOptions(c context.Context, f *filter.F, includeDelete
if f.Limit != nil && len(evs) > int(*f.Limit) {
evs = evs[:*f.Limit]
}
// delete the expired events in a background thread
go func() {
for i, ser := range expDeletes {
if err = d.DeleteEventBySerial(c, ser, expEvs[i]); chk.E(err) {
continue
}
}
}()
// TODO: DISABLED - inline deletion of expired events causes Badger race conditions
// under high concurrent load ("assignment to entry in nil map" panic).
// Expired events should be cleaned up by a separate, rate-limited background
// worker instead of being deleted inline during query processing.
// See: pkg/storage/gc.go TODOs for proper batch deletion implementation.
if len(expDeletes) > 0 {
log.D.F("QueryEvents: found %d expired events (deletion disabled)", len(expDeletes))
}
}
return

View File

@@ -1 +1 @@
v0.52.8
v0.52.9