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

streams: fix fd is null when calling clearBuffer #50994

Merged
merged 1 commit into from
Dec 7, 2023

Conversation

kylo5aby
Copy link
Contributor

@kylo5aby kylo5aby commented Dec 1, 2023

Fixes: #50979

@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/streams

@nodejs-github-bot nodejs-github-bot added the needs-ci PRs that need a full CI run. label Dec 1, 2023
Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please add a test?

@kylo5aby
Copy link
Contributor Author

kylo5aby commented Dec 3, 2023

Can you please add a test?

Resolved. PTAL

Copy link
Member

@rluvaton rluvaton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your contribution

Comment on lines 18 to 28
fileWriteStream.on('finish', () => {
const writtenData = fs.readFileSync(filepath, 'utf8');
assert.strictEqual(writtenData, data);
});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
fileWriteStream.on('finish', () => {
const writtenData = fs.readFileSync(filepath, 'utf8');
assert.strictEqual(writtenData, data);
});
fileWriteStream.on('finish', common.mustCall(() => {
const writtenData = fs.readFileSync(filepath, 'utf8');
assert.strictEqual(writtenData, data);
}));

test/parallel/test-file-write-stream5.js Show resolved Hide resolved
Comment on lines 736 to 737
if ((state[kState] & (kDestroyed | kBufferProcessing | kCorked | kBuffered)) !== kBuffered ||
(state[kState] & (kDestroyed | kBufferProcessing | kCorked | kConstructed)) !== kConstructed) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if ((state[kState] & (kDestroyed | kBufferProcessing | kCorked | kBuffered)) !== kBuffered ||
(state[kState] & (kDestroyed | kBufferProcessing | kCorked | kConstructed)) !== kConstructed) {
if ((state[kState] & (kDestroyed | kBufferProcessing | kCorked | kBuffered | kConstructed)) !== (kBuffered | kConstructed)) {

@kylo5aby
Copy link
Contributor Author

kylo5aby commented Dec 4, 2023

Resolved

@ronag ronag added the request-ci Add this label to start a Jenkins CI on a PR. label Dec 4, 2023
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Dec 4, 2023
@nodejs-github-bot
Copy link
Collaborator

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@rluvaton rluvaton added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. request-ci Add this label to start a Jenkins CI on a PR. labels Dec 6, 2023
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Dec 6, 2023
@nodejs-github-bot
Copy link
Collaborator

@mcollina mcollina added the commit-queue Add this label to land a pull request using GitHub Actions. label Dec 7, 2023
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Dec 7, 2023
@nodejs-github-bot nodejs-github-bot merged commit 639c366 into nodejs:main Dec 7, 2023
59 checks passed
@nodejs-github-bot
Copy link
Collaborator

Landed in 639c366

RafaelGSS pushed a commit that referenced this pull request Dec 15, 2023
PR-URL: #50994
Fixes: #50979
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Raz Luvaton <rluvaton@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
@RafaelGSS RafaelGSS mentioned this pull request Dec 15, 2023
@SamTV12345
Copy link

@mcollina Is this already in the latest release? I am still getting the error.

@mcollina
Copy link
Member

this should be in v21.5.0.

@SamTV12345
Copy link

Thanks. 21 works. 20 doesn't but isn't a problem as I could simply update to 21.

richardlau pushed a commit that referenced this pull request Mar 25, 2024
PR-URL: #50994
Fixes: #50979
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Raz Luvaton <rluvaton@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
@richardlau richardlau mentioned this pull request Mar 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. needs-ci PRs that need a full CI run.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The "fd" argument must be of type number. Received null - Erroring in recent Node versions 20 and 21
7 participants