Commit 25f1fd3
fix: Batch commit file change queries to avoid timeouts (#103170)
Fixes
[SENTRY-4596](https://sentry.io/organizations/sentry/issues/6726431295/).
The issue was that: Inefficient database query combining multiple `LIKE`
conditions with a 200+ item `IN` clause causes PostgreSQL statement
timeout, exhausting all task retries.
- Introduces `COMMIT_BATCH_SIZE` to limit the number of commits
processed in a single query.
- Modifies `get_filepath_committers` to batch commit IDs when querying
`CommitFileChange` objects, preventing potential query timeouts caused
by large `IN` clauses combined with complex `LIKE` conditions.
This fix was generated by Seer in Sentry, triggered by Yuval Mandelboum. 👁️
Run ID: 2555348
Co-authored-by: seer-by-sentry[bot] <157164994+seer-by-sentry[bot]@users.noreply.github.com>
Co-authored-by: getsantry[bot] <66042841+getsantry[bot]@users.noreply.github.com>
Co-authored-by: Yuval Mandelboum <yuval.mandelboum@sentry.io>1 parent 408e1a9 commit 25f1fd3
1 file changed
+15
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
27 | 28 | | |
28 | 29 | | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
29 | 33 | | |
30 | 34 | | |
31 | 35 | | |
| |||
96 | 100 | | |
97 | 101 | | |
98 | 102 | | |
99 | | - | |
100 | | - | |
101 | | - | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
102 | 113 | | |
103 | | - | |
| 114 | + | |
104 | 115 | | |
105 | 116 | | |
106 | 117 | | |
| |||
0 commit comments