Skip to content
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

fix: Long retries #35

Merged
merged 2 commits into from
Oct 4, 2024
Merged

fix: Long retries #35

merged 2 commits into from
Oct 4, 2024

Conversation

nzakas
Copy link
Contributor

@nzakas nzakas commented Oct 4, 2024

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:

  1. Ensures that #processQueue is always called either with setTimeout() or in a promise resolver
  2. Failed tasks are pushed to the back of the queue to wait for another turn rather than the front.

I 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

@nzakas nzakas merged commit c551b31 into main Oct 4, 2024
26 checks passed
@nzakas nzakas deleted the long-retry branch October 4, 2024 16:21
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