inspector: Use default uv_listen backlog size
PR-URL: https://github.com/nodejs/node/pull/20254 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
This commit is contained in:
parent
e8e6e775fb
commit
71059fbfa5
@ -587,7 +587,8 @@ int ServerSocket::Listen(InspectorSocketServer* inspector_server,
|
||||
CHECK_EQ(0, uv_tcp_init(loop, server));
|
||||
int err = uv_tcp_bind(server, addr, 0);
|
||||
if (err == 0) {
|
||||
err = uv_listen(reinterpret_cast<uv_stream_t*>(server), 1,
|
||||
// 511 is the value used by a 'net' module by default
|
||||
err = uv_listen(reinterpret_cast<uv_stream_t*>(server), 511,
|
||||
ServerSocket::SocketConnectedCallback);
|
||||
}
|
||||
if (err == 0) {
|
||||
|
34
test/parallel/test-inspector-stress-http.js
Normal file
34
test/parallel/test-inspector-stress-http.js
Normal file
@ -0,0 +1,34 @@
|
||||
// Flags: --expose-internals
|
||||
'use strict';
|
||||
const common = require('../common');
|
||||
|
||||
common.skipIfInspectorDisabled();
|
||||
|
||||
const assert = require('assert');
|
||||
const { NodeInstance } = require('../common/inspector-helper.js');
|
||||
|
||||
async function testHttp(child, number) {
|
||||
try {
|
||||
await child.httpGet(null, '/json/list');
|
||||
return true;
|
||||
} catch (e) {
|
||||
console.error(`Attempt ${number} failed`, e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
async function runTest() {
|
||||
const child = new NodeInstance(undefined, '');
|
||||
|
||||
const promises = [];
|
||||
for (let i = 0; i < 100; i++) {
|
||||
promises.push(testHttp(child, i));
|
||||
}
|
||||
const result = await Promise.all(promises);
|
||||
assert(!result.some((a) => !a), 'Some attempts failed');
|
||||
return child.kill();
|
||||
}
|
||||
|
||||
common.crashOnUnhandledRejection();
|
||||
|
||||
runTest();
|
Loading…
x
Reference in New Issue
Block a user