fix(sitemap): pre-warm HL-builder cache to avoid concurrent getSpecs races - #984
Merged
Conversation
…ecs races Follow-up on #980. Introducing isHlBuilderSlug() inside a Promise.all over providerSlugs (~100 entries) triggered ~100 concurrent getSpecs() reads on the first prod build because the cache inside isHlBuilderSlug was still null on every callsite. That exhausted the file-descriptor pool during buildFullSitemap and made /sitemap.xml time out on the deploy-time smoke fetch: [smoke] fetching https://openchainbench.com/sitemap.xml [DOMException [AbortError]: This operation was aborted] Fix: warm the cache with a single throwaway call before the Promise.all. Subsequent calls hit the cached Set immediately.
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.
Follow-up hotfix on #980.
The new isHlBuilderSlug() call inside Promise.all over providerSlugs (~100 entries) triggered ~100 concurrent getSpecs() reads because the internal cache was still null on every callsite. That exhausted the fd pool and /sitemap.xml timed out on the deploy-time smoke fetch:
Fix: pre-warm the cache with a single throwaway call before the Promise.all.
Merging direct to main (hotfix path per AGENTS.md) to unblock the prod deploy that's currently rolled back.