Commit 42e2ae9
committed
refactor(engine): drain tasks before eager WINDOW for accept-side child
Replace the conditional task-queue-defer approach (commit bcf7b03 +
Phase 1 cc83e5e/484fb4eb) with a simpler in-line task drain. The
accepted-side WINDOW is once again emitted eagerly inside
ZillaStreamFactory.Stream.onBegin (pre-Phase-1 behaviour). For
accept-side child channels, ZillaEngine.drainTasks() is called between
beginInputFuture.setSuccess() and the eager doWindow so any tasks
queued during fireChannelBound's ACCEPTED-event chain (e.g., an
AdviseInputTask from a `read advise` placed before `connected`) run
synchronously and write their frames to streamsBuffer ahead of the
WINDOW.
Wire order for trick scripts: ACCEPTED → script statements (queue
AdviseInputTask) → drainTasks (CHALLENGE written) → eager WINDOW
written. Same ordering as Phase 1's intended CHALLENGE→WINDOW; no
flag, no submitTask gymnastics.
Wire order for non-trick scripts (e.g., binding-http AdvisoryIT): same
as pre-Phase-1 — no tasks queued before drain runs (drain is a no-op),
eager WINDOW written immediately.
Removes:
- ZillaChannel.windowNeedsTask field + setWindowNeedsTask/windowNeedsTask methods
- ZillaEngine.adviseInput's flag-set call
- ZillaPartition windowFuture listener's doWindow + submitTask logic
(reverts listener to pre-Phase-1: just fireChannelConnected)
Adds:
- ZillaEngine.drainTasks() — package-private, delegates to executeTasks
Tests: engine driver ITs (DuplexIT 72/72, HalfDuplexIT 64/64,
SimplexIT 35/35, EngineIT 14/14); binding-http 374/374 (both
client.AdvisoryIT.shouldSendRequestAndFlush and
server.AdvisoryIT.shouldSendRequestAndFlush restored); binding-mcp
138/138; binding-mcp.spec ApplicationIT/NetworkIT all green.
https://claude.ai/code/session_01Sm5BSDDaRNueem3xUeM2Li1 parent bcf7b03 commit 42e2ae9
4 files changed
Lines changed: 13 additions & 47 deletions
File tree
- runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/k3po/ext/behavior
Lines changed: 0 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
79 | | - | |
80 | 79 | | |
81 | 80 | | |
82 | 81 | | |
| |||
671 | 670 | | |
672 | 671 | | |
673 | 672 | | |
674 | | - | |
675 | | - | |
676 | | - | |
677 | | - | |
678 | | - | |
679 | | - | |
680 | | - | |
681 | | - | |
682 | | - | |
683 | | - | |
684 | 673 | | |
685 | 674 | | |
686 | 675 | | |
| |||
Lines changed: 5 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | 131 | | |
135 | 132 | | |
136 | 133 | | |
| |||
299 | 296 | | |
300 | 297 | | |
301 | 298 | | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
302 | 304 | | |
303 | 305 | | |
304 | 306 | | |
| |||
Lines changed: 1 addition & 27 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
310 | 310 | | |
311 | 311 | | |
312 | 312 | | |
313 | | - | |
314 | | - | |
315 | | - | |
316 | | - | |
317 | | - | |
318 | | - | |
319 | | - | |
320 | | - | |
321 | | - | |
322 | | - | |
323 | | - | |
324 | | - | |
325 | | - | |
326 | | - | |
327 | | - | |
328 | | - | |
329 | | - | |
330 | | - | |
331 | | - | |
332 | | - | |
333 | | - | |
334 | | - | |
335 | | - | |
336 | | - | |
337 | | - | |
338 | | - | |
339 | | - | |
| 313 | + | |
340 | 314 | | |
341 | 315 | | |
342 | 316 | | |
| |||
Lines changed: 7 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
201 | 201 | | |
202 | 202 | | |
203 | 203 | | |
204 | | - | |
| 204 | + | |
205 | 205 | | |
206 | | - | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
207 | 211 | | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
| 212 | + | |
212 | 213 | | |
213 | 214 | | |
214 | 215 | | |
| |||
0 commit comments