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

[v4.x backport] tls: fix writeQueueSize prop, long write timeouts #16422

Closed

Conversation

apapirovski
Copy link
Member

This is a backport of #15791 as requested.

/cc @MylesBorins

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

net, tls, test

@apapirovski apapirovski added net Issues and PRs related to the net subsystem. tls Issues and PRs related to the tls subsystem. labels Oct 23, 2017
@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. lib / src Issues and PRs related to general changes in the lib or src directory. v4.x labels Oct 23, 2017
@apapirovski
Copy link
Member Author

Make writeQueueSize represent the actual size of the write queue
within the TLS socket. Add tls test to confirm that bufferSize
works as expected.

PR-URL: nodejs#15791
Fixes: nodejs#15005
Refs: nodejs#15006
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Add updateWriteQueueSize which updates and returns queue size
(net & tls). Make _onTimeout check whether an active write
is ongoing and if so, call _unrefTimer rather than emitting
a timeout event.

Add http & https test that checks whether long-lasting (but
active) writes timeout or can finish writing as expected.

PR-URL: nodejs#15791
Fixes: nodejs#15082
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
@apapirovski
Copy link
Member Author

apapirovski commented Oct 25, 2017

CI is all green (failure unrelated) and I've rebased.

@apapirovski apapirovski added the blocked PRs that are blocked by other issues or PRs. label Oct 25, 2017
@apapirovski
Copy link
Member Author

This is blocked because of #16484 — working on a PR which will then need to be applied here.

This commit handles the case where _onTimeout is called with a
null handle.

Refs: nodejs#15791
Fixes: nodejs#16484
PR-URL: nodejs#16489
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
@apapirovski apapirovski removed the blocked PRs that are blocked by other issues or PRs. label Oct 25, 2017
@apapirovski
Copy link
Member Author

Last commit is technically from a different PR but this shouldn't land without it.

CI: https://ci.nodejs.org/job/node-test-pull-request/10977/

@MylesBorins
Copy link
Contributor

TBQH, I'm nervous about this landing in v4.x due to the regression that we found. Yes it was only a single regression, but with 4.x going EOL in the next 6 months I'm not sure that the benefit outweighs the risk

/cc @nodejs/lts thoughts?

@mcollina
Copy link
Member

I'm 👎 on landing this on v4.

@apapirovski
Copy link
Member Author

Seems sensible. Closing this. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ Issues and PRs that require attention from people who are familiar with C++. lib / src Issues and PRs related to general changes in the lib or src directory. net Issues and PRs related to the net subsystem. tls Issues and PRs related to the tls subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants