Skip to content

Commit

Permalink
mysql: check for error when getting subtrees (#3173)
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
jsha committed Oct 31, 2023
1 parent 0e31832 commit 8d2d17a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions storage/mysql/tree_storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,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
Expand Down

0 comments on commit 8d2d17a

Please sign in to comment.