Skip to content

Honor cancelled callers during shared VM address lookups - #514

Open
sylvesterkaczmarek wants to merge 2 commits into
openai:mainfrom
sylvesterkaczmarek:fix/cancel-waiting-vm-address-lookups
Open

sylvesterkaczmarek wants to merge 2 commits into
openai:mainfrom
sylvesterkaczmarek:fix/cancel-waiting-vm-address-lookups

Conversation

@sylvesterkaczmarek

Copy link
Copy Markdown

Problem

The endpoint target dialer uses singleflight.Do for VM address resolution. A caller that joins an existing lookup cannot stop waiting when its own context expires. An already-cancelled caller also enters resolution before its context is checked.

Change

Wait on the shared result channel alongside the caller's cancellation signal. Check cancellation before starting resolution and before dialing. Retain lookup coalescing, uncached completed results, and the original first-caller context passed to the resolver; this does not redesign ownership of the shared lookup.

Validation

  • Broad non-hardware suite: 125 tests and 96 subtests passed.
  • Endpoint tests passed with the race detector; changed-code lint reported zero issues.
  • Two new cases fail on unchanged production code: an expired waiter joining a held lookup, and an already-cancelled caller. A control verifies that completed failed lookups are not cached. The held leader still receives its original result.
  • Tests use a controlled resolver and synthetic dialer, without network calls or VMs.
  • Go 1.27.1 on macOS arm64; git diff --check passed. Hardware/runtime integration under internal/tests was not run.

The channel behavior follows the singleflight API. No dependencies or public interfaces change.

Reproduced against f101ade5d8fdcad5e9c346472698649e7107a715.

Signed-off-by: Sylvester Kaczmarek <16242628+sylvesterkaczmarek@users.noreply.github.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant