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

net: always invoke after-write callback #24291

Closed
wants to merge 2 commits into from

Conversation

addaleax
Copy link
Member

This is part of the streams API contract, and aligns
network sockets with other streams in this respect.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines

This is part of the streams API contract, and aligns
network sockets with other streams in this respect.
@nodejs-github-bot nodejs-github-bot added the net Issues and PRs related to the net subsystem. label Nov 10, 2018
@addaleax
Copy link
Member Author

I’d like to land this today or tomorrow.

@nodejs/tsc @nodejs/streams Just pointing out that this does change a test, and I won’t mind if anybody wants to label this semver-major because of it.

CI: https://ci.nodejs.org/job/node-test-pull-request/18554/
CITGM: https://ci.nodejs.org/view/Node.js-citgm/job/citgm-smoker/1613/

@cjihrig
Copy link
Contributor

cjihrig commented Nov 12, 2018

I won’t mind if anybody wants to label this semver-major because of it

I was thinking this when I approved the PR, but didn't mention it. I think I'd be +1 to semver-major.

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, let’s consider it a bugfix. I would be careful with backporting.

A CITGM run would be helpful.

@mcollina
Copy link
Member

I would prefer to have a test on net that verifies this.

@addaleax
Copy link
Member Author

The previous CITGM run had infra issues similar to what we’ve seen before, cc @nodejs/build-infra again

CITGM rebuild: https://ci.nodejs.org/view/Node.js-citgm/job/citgm-smoker/1614/

@addaleax
Copy link
Member Author

@mcollina I’m not sure how to write a simple net-only test for this that doesn’t have the complexity of the test that is being modified here. This doesn’t seem to do the job:

const server = net.createServer(common.mustCall((connection) => {
  connection.end('foo');
})).listen(0, common.mustCall(() => {
  const client = net.connect(server.address().port);
  client.write('bar', common.mustCall(() => server.close()));
  // client.end();
  client.destroy();
}));

@mcollina
Copy link
Member

mcollina commented Nov 12, 2018 via email

@addaleax
Copy link
Member Author

Sigh, CITGM didn’t work again.

New attempt: https://ci.nodejs.org/view/Node.js-citgm/job/citgm-smoker/1617/ (scheduled)

@Trott
Copy link
Member

Trott commented Nov 14, 2018

CITGM rebuild with CITGM_COMMAND = citgm-all -J --excludeTags graceful-fs (h/t @refack):

https://ci.nodejs.org/view/Node.js-citgm/job/citgm-smoker/1626/

@addaleax
Copy link
Member Author

Landed in c347e77

I’ve added the dont-land-on-lts labels, if that’s okay with everyone.

@addaleax addaleax closed this Nov 15, 2018
@addaleax addaleax deleted the net-afterwrite-alwayscb branch November 15, 2018 14:40
addaleax added a commit that referenced this pull request Nov 15, 2018
This is part of the streams API contract, and aligns
network sockets with other streams in this respect.

PR-URL: #24291
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Weijia Wang <starkwang@126.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
BridgeAR pushed a commit that referenced this pull request Nov 15, 2018
This is part of the streams API contract, and aligns
network sockets with other streams in this respect.

PR-URL: #24291
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Weijia Wang <starkwang@126.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
net Issues and PRs related to the net subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.