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

benchmark: http simple connect timeout on macOS #32337

Open
SASUKE40 opened this issue Mar 18, 2020 · 4 comments
Open

benchmark: http simple connect timeout on macOS #32337

SASUKE40 opened this issue Mar 18, 2020 · 4 comments
Labels
benchmark Issues and PRs related to the benchmark subsystem.

Comments

@SASUKE40
Copy link
Contributor

  • Version: v13.11.0
  • Platform: macOS Catalina
  • Subsystem: benchmark

What steps will reproduce the bug?

node benchmark/http/simple.js

How often does it reproduce? Is there a required condition?

Always reproduces.

What is the expected behavior?

It should run without timeout error on macOS.

What do you see instead?

Screen Shot 2020-03-18 at 11 58 44 AM

Additional information

I found that it works when I change duration from 5 to 10. It could be some problem with frequently port binding.

const bench = common.createBenchmark(main, {
  // Unicode confuses ab on os x.
  type: ['bytes', 'buffer'],
  len: [4, 1024, 102400],
  chunks: [1, 4],
  c: [50, 500],
  chunkedEnc: [1, 0],
  duration: 5 // replace with 10, it works
});
@himself65
Copy link
Member

himself65 commented Mar 18, 2020

can you enable NODE_DEBUG=net and log the output?

and it seems like the macOS only issue, it's okay on my windows10 and WSL

@SASUKE40
Copy link
Contributor Author

can you enable NODE_DEBUG=net and log the output?

and it seems like the macOS only issue, it's okay on my windows10 and WSL

NET 98415: SERVER handle? true   connections? 0
NET 98415: emit close
NET 98419: _read
NET 98415: _read
NET 98419: createConnection [
  {
    protocol: 'http:',
    hostname: '127.0.0.1',
    hash: '',
    search: '',
    pathname: '/bytes/4/1/normal/0',
    path: null,
    href: 'http://127.0.0.1:12346/bytes/4/1/normal/0',
    port: 12346,
    host: '127.0.0.1',
    servername: '',
    _agentKey: '127.0.0.1:12346:',
    encoding: null
  },
  [Function: oncreate],
  [Symbol(normalizedArgs)]: true
]
NET 98415: _read
NET 98419: pipe false null
NET 98415: _read
NET 98419: _final: not ended, call shutdown()
NET 98415: _read
NET 98419: _read
NET 98419: _read wait for connection
NET 98415: _read
NET 98419: destroy
NET 98419: close
NET 98415: _read
NET 98419: close handle
NET 98415: _read
NET 98419: afterShutdown destroyed=true ReadableState {
  objectMode: false,
  highWaterMark: 16384,
  buffer: BufferList { head: null, tail: null, length: 0 },
  length: 0,
  pipes: [],
  flowing: true,
  ended: true,
  endEmitted: true,
  reading: false,
  sync: false,
  needReadable: false,
  emittedReadable: false,
  readableListening: false,
  resumeScheduled: false,
  errorEmitted: false,
  emitClose: false,
  autoDestroy: false,
  destroyed: true,
  defaultEncoding: 'utf8',
  awaitDrainWriters: null,
  multiAwaitDrain: false,
  readingMore: false,
  decoder: null,
  encoding: null,
  [Symbol(kPaused)]: false
}
NET 98415: _read
NET 98419: emit close
NET 98415: _read
NET 98419: afterConnect
NET 98415: _read
NET 98419: destroy
NET 98419: close
NET 98419: close handle
NET 98415: _read
events.js:292
      throw er; // Unhandled 'error' event
      ^

Error: connect ETIMEDOUT 127.0.0.1:12346
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1141:16)
Emitted 'error' event on ClientRequest instance at:
    at Socket.socketErrorListener (_http_client.js:432:9)
    at Socket.emit (events.js:315:20)
    at emitErrorNT (internal/streams/destroy.js:84:8)
    at processTicksAndRejections (internal/process/task_queues.js:84:21) {
  errno: -60,
  code: 'ETIMEDOUT',
  syscall: 'connect',
  address: '127.0.0.1',
  port: 12346
}
NET 98415: _read
NET 98415: destroy
NET 98415: close
NET 98415: close handle
NET 98415: destroy
NET 98415: close
NET 98415: close handle
NET 98415: destroy
NET 98415: close
NET 98415: close handle
NET 98415: emit close
NET 98415: emit close
NET 98415: emit close
NET 98415: SERVER _emitCloseIfDrained
Error: test-double-http failed with 1.
    at ChildProcess.<anonymous> (/Users/shilinzhu/github/SASUKE40/node/benchmark/_http-benchmarkers.js:238:16)
    at Object.onceWrapper (events.js:422:26)
    at ChildProcess.emit (events.js:315:20)
    at maybeClose (internal/child_process.js:1026:16)
    at Socket.<anonymous> (internal/child_process.js:441:11)
    at Socket.emit (events.js:315:20)
    at Pipe.<anonymous> (net.js:674:12)

@bnoordhuis
Copy link
Member

It's almost certainly an issue local to your system, like the firewall rejecting localhost connections or macos's network sandboxing system disallowing outgoing connections.

I can't reproduce it on a macos 10.14 system, in any case.

@VictorNanka
Copy link

I got same timeout on my mac.

Version: v13.11.0
Platform: macOS Catalina 10.15.3
Subsystem: benchmark

@SASUKE40

timeout

@targos targos added the benchmark Issues and PRs related to the benchmark subsystem. label Dec 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
benchmark Issues and PRs related to the benchmark subsystem.
Projects
None yet
Development

No branches or pull requests

5 participants