Repository navigation
feat(command-dump): add REDIRECT control frame support - #1759
Merged
Merged
Conversation
Capture the engine's REDIRECT frame (type id 0x40000005, introduced in #1755) in the dump command's pcap output and surface it in the zilla.lua Wireshark dissector. Like RESET, REDIRECT terminates the stream, so it is mapped to a TCP PSH segment. Like BEGIN, the frame carries an int64 affinity and a round-tripped extension, so each binding's extension dissector treats REDIRECT the same as BEGIN. Adds k3po scripts for the client-sent redirect scenario; the IT method is wired but @ignore'd until its tshark-generated expected fixture is regenerated on a docker-enabled host. https://claude.ai/code/session_01K4wd5z8Ejgq4ejTsmL88oh
jfallows
force-pushed
the
feature/redirect-dump
branch
2 times, most recently
from
May 10, 2026 21:03
04a2ab2 to
8c8b397
Compare
Per the engine ABI from #1755, REDIRECT terminates the stream like RESET (EngineWorker dispatcher.remove + Target streams[].remove for both RedirectFW.TYPE_ID and ResetFW.TYPE_ID). The k3po-zilla test transport was leaving the channel in an inconsistent state on both ends, so follow-up cleanup or script steps could emit END / ABORT frames against a stream the engine had already torn down. This produced inconsistent zilla dump pcap output for redirect scenarios. Mirror the existing RESET pattern exactly: - `ZillaSource.doAdviseInput` (ADVISORY_REDIRECT branch) — the caller of `streamFactory.doRedirect` now closes the local READ side after the frame is written, mirroring `doAbortInputAfterBegin` for RESET. The frame writer (`ZillaTarget.doRedirect`) stays state-free, mirroring `ZillaTarget.doReset` / `doAbortInput`. - `Throttle.onRedirect` — on the receiver side, mirror `Throttle.onReset` exactly: `setWriteAborted` + `setWriteClosed` + `fireOutputAborted` + the disconnect / unbind / close events. The receiver is the source of the stream (REDIRECT travels in the throttle direction, opposite the BEGIN), so its WRITE side is what the redirect terminates — same as RESET semantics. The pre-existing `binding-http` `RedirectIT` (`read advise zilla:redirect` + `write aborted` on the application side, added in #1758) was authored against the previous buggy transport behavior and has been failing on develop ever since. With this fix in place it will need to be revisited in a follow-up — that test is unaffected by this commit and remains in the same failure state as on develop's HEAD. Verified: engine surefire 320/320 + failsafe 204/204 (incl. SimplexIT 37/37 with the PR #1755 REDIRECT test). https://claude.ai/code/session_01K4wd5z8Ejgq4ejTsmL88oh
Pair the redirect rpt scripts with `read abort` (client) and `write aborted` (server) so post-REDIRECT teardown is deterministic once the k3po-zilla transport aligns REDIRECT with RESET (#13ad202a1). Add the tshark fixture and unignore the IT method. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
7 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds REDIRECT control frame support across two layers, aligned with the
RESET pattern that the engine ABI from #1755 establishes as the model
for stream-terminating throttle frames.
command-dump—8c8b3971Captures the engine's REDIRECT frame (type id
0x40000005, introducedin #1755) in the
zilla dumpcommand's pcap output and surfaces it inthe
zilla.luaWireshark dissector.ZillaDumpCommand:RedirectFWflyweight (read + builder), dispatchon
RedirectFW.TYPE_IDinhandleFrame, andonRedirectpatches theround-tripped extension and emits the pcap frame with TCP
PSH(likeRESET, since REDIRECT terminates the stream).zilla.lua:REDIRECT_ID = 0x40000005, registered inresolve_frame_type, dispatched viahandle_redirect_frame(affinityBEGIN). Each binding's extensiondissector (
handle_http_extension,handle_grpc_extension,handle_sse_extension,handle_ws_extension,handle_mqtt_extension,handle_kafka_extension) treatsREDIRECTas the BEGIN-style payloadsince the extension is round-tripped from BEGIN.
…/ws/streams/application/advise/client.sent.redirect/{client,server}.rptexercising
write advised zilla:redirect/read advise zilla:redirectwith a non-empty
ws:beginExround-trip.WsAdvisoryApplicationIT#shouldReceiveClientSentRedirectis wiredbut
@Ignore'd pending regeneration of its tshark-generated expectedfixture on a docker-enabled host.
enginek3po-zilla transport teardown —13ad202aPer the engine ABI, REDIRECT terminates the stream like RESET
(
EngineWorker.dispatchandTarget.handle*both calldispatcher.remove/streams[].removeonRedirectFW.TYPE_IDthesame as
ResetFW.TYPE_ID). The k3po-zilla test transport was leavingthe channel in an inconsistent state on both ends, so follow-up cleanup
or script steps could emit END / ABORT frames against a stream the
engine had already torn down — yielding inconsistent
zilla dumpoutput. Mirror the existing RESET pattern exactly:
ZillaSource.doAdviseInput(ADVISORY_REDIRECT branch): the caller ofstreamFactory.doRedirectcloses the local READ side after theframe is written, mirroring
doAbortInputAfterBeginfor RESET. Theframe writer (
ZillaTarget.doRedirect) stays state-free, mirroringZillaTarget.doReset/doAbortInput.Throttle.onRedirect: on the receiver side, full mirror ofThrottle.onReset—setWriteAborted+setWriteClosed+fireOutputAborted+ disconnect/unbind/close events. The receiver isthe source of the stream (REDIRECT travels in the throttle direction,
opposite the BEGIN), so its WRITE side is what the redirect
terminates — same as RESET semantics.
Test plan
./mvnw -pl incubator/command-dump install -DskipTests -DskipITscompiles cleanly with the generated
RedirectFW../mvnw -pl incubator/command-dump checkstyle:checkreports 0violations.
./mvnw -pl runtime/engine clean verifygreen — surefire 320/320+ failsafe 204/204 (incl.
SimplexIT37/37, with the REDIRECTtest from feat(engine): add REDIRECT control frame primitive #1755).
13ad202a.shouldReceiveClientSentRedirectand regenerateWsAdvisoryApplicationIT_shouldReceiveClientSentRedirect.txtviathe docker-based tshark runner; verify the dissector output
matches the expected REDIRECT layout (frame type, affinity,
round-tripped ws extension).
zilla dumpagainst an enginethat emits REDIRECT and opening the resulting pcap in Wireshark
with the updated
zilla.luaplugin.Closes the dump-command gap from #1753.
https://claude.ai/code/session_01K4wd5z8Ejgq4ejTsmL88oh