From ca48b604345584186be97f72e93ab17c7f75b641 Mon Sep 17 00:00:00 2001 From: jedarden Date: Thu, 25 Jun 2026 01:46:54 -0400 Subject: [PATCH] fix(db): add LIMIT to fetchSeriesGames query to prevent OOMKill The fetchSeriesGames function was querying all games for a series without a limit. With up to 1000 series being fetched, and potentially many games per series, this could return an unbounded number of rows and cause OOMKill. A typical series has 3-7 games (best-of-5 or best-of-7), so LIMIT 100 is more than sufficient to handle edge cases while preventing memory exhaustion. Fixes acb-index-builder CrashLoopBackOff caused by OOMKill after web asset copy. --- cmd/acb-index-builder/db.go | 1 + 1 file changed, 1 insertion(+) diff --git a/cmd/acb-index-builder/db.go b/cmd/acb-index-builder/db.go index de1ae5d..db86ccd 100644 --- a/cmd/acb-index-builder/db.go +++ b/cmd/acb-index-builder/db.go @@ -522,6 +522,7 @@ func fetchSeriesGames(ctx context.Context, db *sql.DB, seriesID int64) ([]Series LEFT JOIN matches m ON sg.match_id = m.match_id WHERE sg.series_id = $1 ORDER BY sg.game_num + LIMIT 100 `, seriesID) if err != nil { return nil, err