Stack 4/5: Session Disconnect / Reconnect (same client)#17
Closed
irvingouj@Devolutions (irvingoujAtDevolution) wants to merge 5 commits into
Closed
Stack 4/5: Session Disconnect / Reconnect (same client)#17irvingouj@Devolutions (irvingoujAtDevolution) wants to merge 5 commits into
irvingouj@Devolutions (irvingoujAtDevolution) wants to merge 5 commits into
Conversation
irvingouj@Devolutions (irvingoujAtDevolution)
left a comment
Collaborator
Author
There was a problem hiding this comment.
Findings:
- [P1] Accept header-only Disconnect/Reconnect responses in this PR. The new
accept_disconnect_response/accept_reconnect_responsecode requires<rsp:DisconnectResponse/>and<rsp:ReconnectResponse/>body elements, but real Windows WinRM responses can have an empty SOAP Body and identify the operation only through thea:Actionheader. In this branch, the empty-body DisconnectResponse is classified asInvalidResponseand ignored as “non-disconnect traffic,” leaving the pool stuck inDisconnecting; the same shape for Reconnect fails outright. The header-action fallback that appears later in the stack should move down here, with tests, because this PR is the one introducing disconnect/reconnect behavior.
680d3aa to
ced3eb0
Compare
4f16a5b to
27895e3
Compare
Collaborator
Author
|
Addressed in 27895e3 (now this PR's tip). The header-action fallback was moved down here: |
…l servers Live Windows WinRM answers shell Disconnect/Reconnect with an empty s:Body and identifies the operation solely via the a:Action header (.../shell/DisconnectResponse, .../shell/ReconnectResponse), unlike the documented rsp:*Response body element our unit fixtures assumed. The parser required the body element, so the real response was classified as tolerated non-disconnect traffic and the runspace pool stayed stuck in Disconnecting forever. - add WsAction::DisconnectResponse / ReconnectResponse URIs - accept_disconnect_response / accept_reconnect_response now also match on the Action header (body element still accepted) - log the tolerated body in the disconnecting tolerance path for future wire-level diagnosis - unit tests encode the captured live-server envelope shape, plus a negative test keeping unrelated traffic rejected Validated live: disconnect_reconnect_e2e and reattach_e2e both pass against a real WinRM server.
ced3eb0 to
f242119
Compare
27895e3 to
76f10d3
Compare
Collaborator
Author
|
Superseded by #18, retargeted to master to land the full stack as a single merge now that review is complete. Same commits; no code lost. |
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.
Stack 4/5 — Session Disconnect / Reconnect (same client)
Base:
stack/3-jea-config· Review PRs 1–3 first.What this PR does
PSRP sessions survive client disconnection (MS-WSMV Disconnect/Reconnect). The state enums existed; the operations did not.
ironposh-winrm:WsAction::Disconnect/Reconnect+ body types + response parsing.ironposh-client-core:RunspacePoolfire/accept state transitions with guards (Disconnecting = 10), fault surfacing, connection-id fault correlation.ironposh-async+ tokio REPL:disconnect()/reconnect()client methods, aPoolLifecycleEventchannel,:disconnect/:reconnectREPL commands.:reconnectis non-fatal instead of killing the session; faulted Disconnect reverts to Opened instead of hanging; mid-pipeline reconnect resumes the pipeline.Core / web exposure
Verification
fmt / clippy / workspace tests green. Disconnect→reconnect validated live (
$x = 42survives a disconnect/reconnect cycle).