Skip to content

fix(index): avoid deadlock while looking up pending external components - #669

Open
madesst wants to merge 2 commits into
pb33f:mainfrom
madesst:fix/nonblocking-component-lookup
Open

madesst wants to merge 2 commits into
pb33f:mainfrom
madesst:fix/nonblocking-component-lookup

Conversation

@madesst

@madesst madesst commented Oct 22, 2026 •

Copy link
Copy Markdown

Summary

Avoid waiting for another document's completed reference index when looking up an external component. The target's parsed YAML is sufficient for the lookup and is already available through GetContentAsYAMLNode.

lookupRolodex can be called while two files are being indexed concurrently. If each references the other, waiting on the other file's indexingComplete channel can deadlock even though the referenced schema graph is finite. Keep using the target index when it is already available; otherwise resolve the component from its parsed content.

Add a regression with a loaded target file whose index is pending. It proves that component lookup completes without waiting for indexing; the test fails on unchanged main and passes with this change.

Validation

  • GOWORK=off go test -p=2 ./... -timeout=180s
  • GOWORK=off go test -p=2 ./index ./bundler -count=1 -timeout=180s
  • GOWORK=off go test -race -p=2 ./index -run '^TestLookupRolodexDoesNotWaitForTargetIndex$' -count=1 -timeout=60s
  • GOWORK=off go vet ./index ./bundler
  • gofmt and git diff --check

The companion Vacuum fragment-policy fix is daveshanley/vacuum#1007. With both fixes applied, the consumer's complete OpenAPI/JSON Schema lint, negative audience-boundary/traversal/symlink fixtures, and composed public-webhook bundling pass without suppressing reference errors.

Made with Codex

Co-authored-by: OpenAI Codex <codex@openai.com>
@codecov

codecov Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (e0e2f84) to head (69a4cc3).

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #669   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          309       309           
  Lines        39178     39176    -2     
=========================================
- Hits         39178     39176    -2     
Flag Coverage Δ
unittests 100.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Cover the retained local/remote WaitForIndexing API directly after removing its use from component lookup, and verify an untracked context is not considered indexing.

Co-authored-by: OpenAI Codex <codex@openai.com>
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