fs/promises: fix fd resource cleanup#35208
Closed
bnoordhuis wants to merge 1 commit intonodejs:masterfrom
Closed
Conversation
Contributor
|
Looking at git blame, it looks like d00d81e intentionally removed the |
aduh95
reviewed
Sep 15, 2020
lib/internal/fs/promises.js
Outdated
Contributor
There was a problem hiding this comment.
Suggested change
| return fchmod(fd, mode).finally(fd.close.bind(fd)); | |
| return fchmod(fd, mode).finally(FunctionPrototypeBind(fd.close, fd)); |
Contributor
|
Is there a way we can add a test for this? |
3cf0f4d to
ae6aea0
Compare
Member
Author
Right, I did see that commit and I understand how it works but it doesn't look Obviously Right to me. But if other people feel it's great idea, then the thing to do is to at least be consistent. I've changed it to remove the |
crypt096
approved these changes
Sep 16, 2020
cjihrig
approved these changes
Sep 16, 2020
shisama
approved these changes
Sep 17, 2020
addaleax
approved these changes
Sep 21, 2020
Collaborator
Collaborator
Contributor
Commit Queue failed- Loading data for nodejs/node/pull/35208 ✔ Done loading data for nodejs/node/pull/35208 ----------------------------------- PR info ------------------------------------ Title fs/promises: fix fd resource cleanup (#35208) Author Ben Noordhuis (@bnoordhuis) Branch bnoordhuis:fix-fs-promises-fd-close -> nodejs:master Labels fs Commits 1 - fs/promise: remove unnecessary Function#bind() Committers 1 - Ben Noordhuis PR-URL: https://github.com/nodejs/node/pull/35208 Reviewed-By: Colin Ihrig Reviewed-By: Masashi Hirano Reviewed-By: Anna Henningsen ------------------------------ Generated metadata ------------------------------ PR-URL: https://github.com/nodejs/node/pull/35208 Reviewed-By: Colin Ihrig Reviewed-By: Masashi Hirano Reviewed-By: Anna Henningsen -------------------------------------------------------------------------------- ✔ Last GitHub Actions successful ℹ Last Full PR CI on 2020-10-04T09:58:54Z: https://ci.nodejs.org/job/node-test-pull-request/33368/ - Querying data for job/node-test-pull-request/33368/ ✔ Build data downloaded ✔ Last Jenkins CI successful ℹ This PR was created on Tue, 15 Sep 2020 13:02:12 GMT ✔ Approvals: 3 ✔ - Colin Ihrig (@cjihrig) (TSC): https://github.com/nodejs/node/pull/35208#pullrequestreview-489637752 ✔ - Masashi Hirano (@shisama): https://github.com/nodejs/node/pull/35208#pullrequestreview-490204047 ✔ - Anna Henningsen (@addaleax): https://github.com/nodejs/node/pull/35208#pullrequestreview-493011764 -------------------------------------------------------------------------------- ✔ No git cherry-pick in progress ✔ No git am in progress ✔ No git rebase in progress -------------------------------------------------------------------------------- - Bringing origin/master up to date... From https://github.com/nodejs/node * branch master -> FETCH_HEAD ✔ origin/master is now up-to-date - Downloading patch for 35208 From https://github.com/nodejs/node * branch refs/pull/35208/merge -> FETCH_HEAD ✔ Fetched commits as d3969003b564..ae6aea04b839 -------------------------------------------------------------------------------- Auto-merging lib/internal/fs/promises.js warning: inexact rename detection was skipped due to too many files. warning: you may want to set your merge.renamelimit variable to at least 2818 and retry the command. [master 3c2a1e9af5] fs/promise: remove unnecessary Function#bind() Author: Ben Noordhuis Date: Tue Sep 15 18:40:39 2020 +0200 1 file changed, 1 insertion(+), 1 deletion(-) ✔ Patches applied -------------------------------------------------------------------------------- --------------------------------- New Message ---------------------------------- fs/promise: remove unnecessary Function#bind() Commit Queue action: https://github.com/nodejs/node/actions/runs/351509796 |
aduh95
pushed a commit
that referenced
this pull request
Nov 7, 2020
PR-URL: #35208 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Masashi Hirano <shisama07@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Contributor
|
Landed in f06f3c0 |
danielleadams
pushed a commit
that referenced
this pull request
Nov 9, 2020
PR-URL: #35208 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Masashi Hirano <shisama07@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Merged
BethGriggs
pushed a commit
that referenced
this pull request
Dec 9, 2020
PR-URL: #35208 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Masashi Hirano <shisama07@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
BethGriggs
pushed a commit
that referenced
this pull request
Dec 10, 2020
PR-URL: #35208 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Masashi Hirano <shisama07@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Merged
BethGriggs
pushed a commit
that referenced
this pull request
Dec 15, 2020
PR-URL: #35208 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Masashi Hirano <shisama07@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
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.
Untested, but the existing code looks just plain wrong - the more so because line 403 does call
fs.close.bind(fd).