Commit 9bfd3d3
Fix resolve_futures poll_ready blocking on pending futures (#2662)
In `ResolveFutures::poll_ready`, the call to `empty_ready` would return
`Pending` when the queue contained unresolved futures in blocking mode
(no subgraph_waker). This prevented callers from ever calling `start_send`
to add new futures, effectively serializing the queue to one future at a
time.
The fix makes `poll_ready` always return `Done` after opportunistically
draining any ready futures. The `Pending` behavior is preserved in
`poll_flush`, which correctly blocks until all futures resolve before
flushing downstream.
Changes:
- `dfir_pipes/src/push/resolve_futures.rs`:
- `poll_ready` now discards the `empty_ready` result and always returns
`Done`, allowing callers to keep adding futures to the queue.
- Added regression test `poll_ready_allows_send_while_futures_pending`
that uses a two-poll future to verify `poll_ready` doesn't block.
- Updated comment on the `Pending` branch in `empty_ready` to clarify
it's only relevant for `poll_flush`.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>1 parent 3e6e26c commit 9bfd3d3
1 file changed
Lines changed: 73 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
90 | | - | |
91 | | - | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
92 | 94 | | |
93 | 95 | | |
94 | 96 | | |
| |||
110 | 112 | | |
111 | 113 | | |
112 | 114 | | |
113 | | - | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
114 | 119 | | |
115 | 120 | | |
116 | 121 | | |
| |||
160 | 165 | | |
161 | 166 | | |
162 | 167 | | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
163 | 233 | | |
164 | 234 | | |
165 | 235 | | |
| |||
0 commit comments