-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
test: add a test for "tls.Socket" with "StreamWrap" and "allowHalfOpen" #23866
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once again, nice work!
@oyyd Actually … do you know why there are a write request and a shutdown request simultaneously in that code? In |
@addaleax Line 1236 in 6223236
As But, again, Maybe some of our old code used them somehow, but IDK. The usage of If you are suggesting removing them, I would agree with that. |
@oyyd As you say, the line you’re pointing to is for server sockets, so I don’t think that’s an issue… The thing is, generally there should only be 1 ShutdownWrap or 1 WriteWrap be active for a certain stream, ever… it’s okay that |
I agree.
I'm not totally sure but I guess it doesn't, or my intention is different. My original intention is that I noticed that some node/lib/internal/wrap_js_stream.js Lines 118 to 119 in 6223236
But it works well because when a For those writing operations don't emit |
Test failed: parallel/test-https-host-headers logtest https server listening on port 41235 Error: 4395995780336:error:1408F119:SSL routines:ssl3_get_record:decryption failed or bad record mac:../deps/openssl/openssl/ssl/record/ssl3_record.c:469: |
|
@addaleax Oops, I guess I was taking Node 10.x as my "control group" by mistake.. But I still have some doubt about the reason. Let me dig into this a bit. |
Yes. Therefore I prefer not to modify the code if we couldn't find clear goodness it could bring. But I think it's fine to keep the test for #23654. I have modified the title and description of this PR. BTW, another place that is confusing to me is that if we don't call Then the sockets won't hang anymore on Node 10.13.0. This needs more investigation but we could discuss it elsewhere. |
This test ensures that a tls client socket using `StreamWrap` with `allowHalfOpen` option won't hang.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still very much LGTM :)
Landed in aa82a21, thanks for the PR! 🎉 |
Partially revert b7e6ccd because it broke a test that was added since its last CI run. Refs: nodejs#24075 Refs: nodejs#23866
Partially revert b7e6ccd because it broke a test that was added since its last CI run. Refs: nodejs#24075 Refs: nodejs#23866 PR-URL: nodejs#24288 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com>
A tls client socket usingStreamWrap
withallowHalfOpen
option might hang instead of exiting automatically because the 'drain' event may not be emitted. This commit corrects it by makingStreamWrap
trydoShutdown
infinishWrite
.Before this commit, running the following test will make processes hang.This test ensures that a tls client socket using
StreamWrap
withallowHalfOpen
option won't hang.Refs: #23654
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes