Commit f28f91c
authored
fix(database_observability.mysql): Ensure result sets are properly closed (#5893)
### Brief description of Pull Request
Fixes:
- In `schema_details`, moved the `defer rs.Close()` statement to after
the loop, to ensure result set is closed at the end of its loop rather
than holding connections open until the function returns.
- In `setup_consumers`, added missing error check on result set after
iteration.
### Pull Request Details
<!-- Detailed descripion of the Pull Request, if needed. -->
### Issue(s) fixed by this Pull Request
<!-- Fixes #issue_id -->
### Notes to the Reviewer
<!-- Relevant notes for reviewers/testers. -->
### PR Checklist
<!-- Remove items that do not apply. For completed items, change [ ] to
[x]. -->
- [ ] Documentation added
- [ ] Tests updated
- [ ] Config converters updated1 parent 9dc2e83 commit f28f91c
File tree
2 files changed
+9
-3
lines changed- internal/component/database_observability/mysql/collector
2 files changed
+9
-3
lines changedLines changed: 5 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
272 | 272 | | |
273 | 273 | | |
274 | 274 | | |
275 | | - | |
276 | 275 | | |
277 | 276 | | |
278 | 277 | | |
| |||
298 | 297 | | |
299 | 298 | | |
300 | 299 | | |
301 | | - | |
302 | | - | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
303 | 305 | | |
304 | 306 | | |
305 | 307 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
135 | 135 | | |
136 | 136 | | |
137 | 137 | | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
138 | 142 | | |
139 | 143 | | |
0 commit comments