-
Notifications
You must be signed in to change notification settings - Fork 432
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(cli): add --max-fetch-concurrency
to prevent stalled validators
#7450
Merged
Conversation
This file contains 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
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
No changes to documentation |
Component Testing Report Updated Aug 30, 2024 3:18 PM (UTC) ✅ All Tests Passed -- expand for details
|
cngonzalez
approved these changes
Sep 3, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gave it a quick read but it makes sense to me!
This was referenced Sep 25, 2024
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.
Description
This PR addresses an issue where the
sanity documents validate
CLI command times out for complex validation rules. The problem occurs when a set of documents with custom validators requires more concurrentclient.fetch
requests than the current hard-coded limit allows, potentially causing the validation process to block indefinitely.Changes introduced:
--max-fetch-concurrency
.These changes aim to prevent situations where the validation process exhausts the available concurrent requests, leading to timeouts.
Related issue: SDX-1617
What to review
validateAction.ts
,validateDocuments.ts
, andvalidateDocument.ts
to ensure the newmaxFetchConcurrency
option is correctly implemented and passed through the validation process.validateDocumentsCommand.ts
to confirm the new--max-fetch-concurrency
CLI flag is properly documented.maxCustomValidationConcurrency
andmaxFetchConcurrency
are set correctly (5 and 25, respectively).Testing
To test these changes:
sanity documents validate
command on a dataset with complex validation rules that previously timed out.--max-fetch-concurrency
to ensure it affects the validation process as expected.--max-custom-validation-concurrency
value doesn't cause timeouts when combined with the increased fetch concurrency.I manually tested these changes by running a reproduction locally using the dataset and repo provided by Ken Jones (see slack thread attached to the ticket). With the increased fetch concurrency limit of 25, the validation process completed successfully without timeouts, confirming that the changes resolve the issue in this specific case.
Additional automated tests should be added to verify the behavior of the new concurrency settings.
Notes for release
This update addresses an issue where the
sanity documents validate
CLI command could time out when validating documents with complex custom validation rules. The changes include:--max-fetch-concurrency
to allow users to adjust the maximum number of concurrentclient.fetch
requests during validation.Usage:
These changes should improve the performance and reliability of document validation for projects with complex custom validation rules. Users experiencing timeouts during validation should try increasing the
--max-fetch-concurrency
value if issues persist with the new default.