dont forget to retry#217
Closed
nlf wants to merge 2 commits intoisaacs:masterfrom
Closed
Conversation
isaacs
reviewed
Jul 22, 2021
2dbe3ad to
02b4099
Compare
02b4099 to
18b7fd4
Compare
wraithgar
reviewed
Aug 5, 2021
|
|
||
| // if we don't have a startTime we have no way of knowing if we've waited | ||
| // long enough, so go ahead and retry this item now | ||
| if (startTime === undefined) { |
Contributor
Author
There was a problem hiding this comment.
older versions of this library use the same global queue, this is some defensive coding to make sure if a user is somehow using two versions at the same time we don't do whacky things
|
The merged commit seems to contain some changes that aren't present in this PR, which cause graceful-fs to suddenly start breaking in node <= 4: e4ee5d6#r54480099 |
isaacs
pushed a commit
that referenced
this pull request
Aug 5, 2021
PR-URL: #217 Credit: @nlf Close: #217 Reviewed-by: @isaacs, @wraithgar
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.
if a user is only running one fs operation at a time, and that operation fails with an EMFILE, we never call their callback. because of that the event loop no longer has anything to do and the entire process silently exits.
this change makes it so we start retrying an operation immediately, rather than waiting for another operation to finish successfully or
fs.close/fs.closeSyncto be called. in the callbacks for those, we now reset all state for everything in the queue and make sure the retry loop is running, this will make sure things retry sooner if they can.the retry now keeps running every tick until the queue is empty. items are removed from the queue either when we retry them, or when they've reached a maximum of 60 seconds. this corrects the contract so that we will not stop trying to process the queue until every item in it has had its callback fired one way or another.