Commit af27717
fix(dashboard): ensure query_end fires when generator is abandoned early (Eventual-Inc#6326)
## Summary
- When `.show()` collects enough rows, it breaks out of the `run_iter`
generator early. Python sends `GeneratorExit` (a `BaseException`) which
none of the existing exception handlers caught, so `_notify_query_end`
was never called and the dashboard stayed stuck in "Finalizing" forever.
- Handle `GeneratorExit` in `run_iter` to notify subscribers before
returning.
- Add regression test that verifies `on_query_end` fires for both
`.collect()` and `.show()`.
Closes DF-1664
## Test plan
- [x] New test `test_show_fires_query_end` reproduces the bug (fails
without the fix, passes with it)
- [x] All existing subscriber tests pass (`tests/test_subscribers.py`)
- [x] Manually verified with the dashboard — query transitions from
Finalizing to Finished
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>1 parent 623e8b1 commit af27717
2 files changed
+44
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
142 | 151 | | |
143 | 152 | | |
144 | 153 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
142 | 177 | | |
143 | 178 | | |
144 | 179 | | |
| |||
0 commit comments