Skip to content

Conversation

@ronag
Copy link
Member

Adds a test to ensure that 'finish' is emitted
before the socket is destroyed by allow half-open
enforcer.

Refs: 3c07b17#commitcomment-38810268

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

Adds a test to ensure that 'finish' is emitted before the socket is destroyed by allow half-open enforcer. Refs: nodejs@3c07b17#commitcomment-38810268
@nodejs-github-botnodejs-github-bot added the test Issues and PRs related to the tests. label Apr 28, 2020
@ronag
Copy link
MemberAuthor

review with ignore whitespace

@ronagronag added the net Issues and PRs related to the net subsystem. label Apr 28, 2020
@ronag
Copy link
MemberAuthor

This is a problem on v14. So we should backport this test together with a fix. Unfortunately the semver-major fix on master (#31806) cannot be backported.

@ronagronag requested a review from lpincaApril 28, 2020 21:55
socket.on('end',common.mustCall(()=>{
assert(!socket.destroyed);
}));
socket.end('asd');
Copy link
MemberAuthor

@ronagronagApr 29, 2020

Choose a reason for hiding this comment

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

calling end() here is the main difference with the previous test


{
constserver=net.createServer(common.mustCall((socket)=>{
socket.end(Buffer.alloc(1024));
Copy link
Member

Choose a reason for hiding this comment

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

Is this needed now that the end() is also called on the client? Shouldn't this socket be resumed to consume the data sent by the client?

Copy link
MemberAuthor

@ronagronagApr 29, 2020

Choose a reason for hiding this comment

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

Not sure, it does trigger the bug on v14 in the current form though...

@nodejs-github-bot
Copy link
Collaborator

@ronagronag added the review wanted PRs that need reviews. label May 4, 2020
@ronagronag mentioned this pull request May 5, 2020
4 tasks
@BridgeAR
Copy link
Member

@nodejs/streams @nodejs/http @nodejs/http2 this needs some reviews. It's open for quite a while by now.

@nodejs-github-bot
Copy link
Collaborator

@BridgeARBridgeARforce-pushed the master branch 2 times, most recently from 8ae28ff to 2935f72CompareMay 31, 2020 12:18
@jasnell
Copy link
Member

Ping @nodejs/streams

Copy link
Member

@jasnelljasnell left a comment

Choose a reason for hiding this comment

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

LGTM but definitely would like @mcollina's opinion

Copy link
Member

@mcollinamcollina left a comment

Choose a reason for hiding this comment

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

lgtm

@nodejs-github-bot
Copy link
Collaborator

ronag added a commit that referenced this pull request Jun 24, 2020
Adds a test to ensure that 'finish' is emitted before the socket is destroyed by allow half-open enforcer. Refs: 3c07b17#commitcomment-38810268 PR-URL: #33137 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
@ronag
Copy link
MemberAuthor

Landed in 2ccf15b

@ronagronag mentioned this pull request Jul 14, 2020
2 tasks
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

netIssues and PRs related to the net subsystem.review wantedPRs that need reviews.testIssues and PRs related to the tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants

@ronag@nodejs-github-bot@BridgeAR@jasnell@mcollina@lpinca@trivikr