Commit 409297e
Fix memoryWatchStage.Wait() to always call stopWatching()
Wait() returned the inner stage's error immediately without
calling stopWatching(), which meant the memory watcher goroutine
was never cancelled when the stage exited with an error (e.g.,
from being killed due to memory limit). This prevented the
observer from logging peak memory usage on kill.
Fix: always call stopWatching() before returning, regardless of
whether the inner stage returned an error.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 5fc3eb7 commit 409297e
2 files changed
Lines changed: 10 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
297 | 297 | | |
298 | 298 | | |
299 | 299 | | |
300 | | - | |
301 | | - | |
302 | | - | |
| 300 | + | |
303 | 301 | | |
304 | | - | |
| 302 | + | |
305 | 303 | | |
306 | 304 | | |
307 | 305 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
132 | 140 | | |
133 | 141 | | |
134 | 142 | | |
| |||
0 commit comments