From 8bfafabff8aa0f2b32e22b6b29f1b2e7e949fc2b Mon Sep 17 00:00:00 2001 From: Jacob Hoffman-Andrews Date: Mon, 30 Oct 2023 17:07:32 -0700 Subject: [PATCH] mysql: check for error when getting subtrees treeTX.getSubtrees iterates over a set of rows from `database/sql`, but it was failing to check the error status after exiting the for loop that iterates over them. On our log deployment, this is causing mistaken error messages of `preload did not get all tiles` when the real error should be propagated from mysql (in our case, max_statement_time exceeded). --- storage/mysql/tree_storage.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/storage/mysql/tree_storage.go b/storage/mysql/tree_storage.go index 52ca479b66..0788b59bd6 100644 --- a/storage/mysql/tree_storage.go +++ b/storage/mysql/tree_storage.go @@ -244,6 +244,10 @@ func (t *treeTX) getSubtrees(ctx context.Context, treeRevision int64, ids [][]by } } + if err := rows.Err(); err != nil { + return nil, err + } + // The InternalNodes cache is possibly nil here, but the SubtreeCache (which called // this method) will re-populate it. return ret, nil