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.
ESLint reported that some users were still getting EMFILE errors even with using Retry.
The primary problem is that
#processQueue
was being called recursively, and when a lot of retries were necessary, this caused a stack overflow error.There was another problem where a failed task was pushed to the front of the queue, allowing it to fail repeatedly while other tasks in the queue sat without being evaluated. Those tasks would then end up timing out and throwing the EMFILE error that they held.
This PR fixes both issues:
#processQueue
is always called either withsetTimeout()
or in a promise resolverI also added a test for fails for long retries prior to this fix. This will now be run as part of CI.
Refs eslint/eslint#18977