-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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
read ECONNRESET at TLSWrap.onStreamRead #35824
Comments
Can you post your code, the default server doesn't do that. One of the causes can be blocking the event loop. |
In order to avoid the influence of the framework, http2 module is used for testing. 'use strict'
const http2 = require('http2')
const fs = require('fs')
process.chdir(__dirname)
let serv = http2.createSecureServer({
cert : fs.readFileSync('./rsa/localhost.cert'),
key : fs.readFileSync('./rsa/localhost.key')
})
serv.on('stream', (stream, headers) => {
stream.on('frameError', (type,code,id)=>{})
stream.on('error', (err) => {stream.destroy()})
stream.on('aborted', () => {
if (!stream.destroyed) {
stream.destroy()
}
})
stream.on('data', chunk => {
})
stream.on('end', () => {
stream.end('ok')
})
})
serv.on('tlsClientError', (err, tls) => {
console.error(err)
tls.destroy()
})
serv.setTimeout(5000, (sess) => {
sess.destroy()
})
serv.on('connection', (sock) => {
sock.setTimeout(2000, () => {
if (!sock.destroyed) {
sock.destroy()
}
})
})
serv.listen(1235) test command:
|
I confirm that there is indeed a bug in the TLS code, both in 14.x and master |
Add an error handler to the underlying TLSWrap socket mostly for the occasional ECONNRESET that a Linux kernel might throw under heavy load Send a tlsClientError event in this case instead of an uncatcheable socket error Fixes: nodejs#35824
@master-genius I replaced the uncatchable error with a tlsClientError event |
@master-genius, @lpinca is right, your error can (and should be) handled in the user code:
|
@mmomtchev ok, thanks. |
I had the same issue with my mediasoup server. Earlier, it randomly crashed with the same exception:
after applying the 'error' handler
I've started receiving another crash:
Considering that THERE IS an The I use node |
@Kukunin This is different than the recent issue #36180 |
My client is a browser. My server is an SFU for WebRTC using mediasoup, it handles a lot of clients simultaneously. The problem is not ECONNRESET itself, I know what it is. The problem is that the whole server process crashes with I've upgraded to Node v15.2.1, it hasn't been crashing for 26 hours already. Maybe it's something that was fixed already. I captured network traffic with |
The TLS phase is also important: if you go through this discussion, my PR and @lpinca's comment, you will see that the TLS error handler is in Node during the handshake then once the user data starts flowing, it is expected that the user code handles it. |
And instead of simply ignoring the |
Thank you for your answers. I can confirm, that upgrading to node |
Hi @mmomtchev, Client is, Another NodeJs server using "http" lib to make the POST call. Error we got Error: read ECONNRESET Node.js v17.6.0` and we had, all expected cases `httpServer.createServer((request, response) => {
/* on client conention error / this occurred, when, generally when traffic is reaching to the 4000+ TPS. Kindly help. Thanks & Regards |
@jaiswarvipin, this is Sparta |
I am sorry, did understand, cloud you pls elaborate and help |
<script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/3.1.0/socket.io.js" integrity="sha512-+l9L4lMTFNy3dEglQpprf7jQBhQsQ3/WvOnjaN/+/L4i0jOstgScV0q2TjfvRF4V+ZePMDuZYIQtg5T4MKr+MQ==" crossorigin="anonymous"></script> in device
in server.js |
Hi team, read ECONNRESET I am using the https call module and this happens only when there is connecting from external vendor api which is not internal network and I don't see this issue when there is internal applications with in the network. Currently I am using the Node version in my docker file as |
@gopinash, I will explain you the problem with this issue. |
similar issue here, any hint help to solve the issue would be appreciated?
|
looks the issue is due to the concurrent issue, when i limit the count of promises to 10 in |
What steps will reproduce the bug? [dev:start] Error: read ECONNRESET |
What steps will reproduce the bug?
I create http2 server and benchmark use ab:
after this, the server is crashed.
I had try to handle all 'error' event (socket, http2Stream, http2Session), but all are ineffective.
The text was updated successfully, but these errors were encountered: