fix(executor): return full inspect payload from expectState to avoid …#42
Open
harshjainnn wants to merge 1 commit into
Open
fix(executor): return full inspect payload from expectState to avoid …#42harshjainnn wants to merge 1 commit into
harshjainnn wants to merge 1 commit into
Conversation
…duplicate container inspect expectState already performs a full ContainerInspect internally but only returned the container id, forcing resolvePortTarget to inspect the same container a second time just to read NetworkSettings. This doubled the Docker Engine round-trip on every proxied HTTP request and WebSocket upgrade in sandbox-proxy. expectState now returns the full ContainerInspectInfo payload. All existing call sites are updated to read .Id off the returned object. resolvePortTarget reads NetworkSettings from the same payload instead of calling .inspect() again. The rejection message contract remains sole-sourced in contract/lifecycle.ts.
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.
What & why
expectStateinexecutor/docker.tsperforms a fullContainerInspectbut discards everything except the container id.resolvePortTargetthen inspects the same container again immediately after, just to readNetworkSettings— data the first call already had. SinceresolvePortTargetruns once per proxied HTTP request and once per WebSocket upgrade, this added one extra Docker Engine round-trip (plus JSON parsing) to every proxied connection.expectStatenow returns the fullContainerInspectInfopayload instead of just the id. All ~16 existing call sites are updated to read.Idoff the returned object.resolvePortTargetreadsNetworkSettingsfrom the same payload instead of calling.inspect()again. The rejection-message contract (contract/lifecycle.ts:233-241) is untouched and remains sole-sourced insideexpectState— this removes a call rather than duplicating logic.Closes #35
Checklist
pnpm build && pnpm typecheck && pnpm lint && pnpm testpasses locally (build first — the e2e suite runs the built daemon)@dormice/shared/sdk/clihave a changeset (pnpm changeset)