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

feat: print more socket info on UND_ERR_CONNECT_TIMEOUT error #477

Merged
merged 5 commits into from
Dec 4, 2023

Conversation

fengmk2
Copy link
Member

@fengmk2 fengmk2 commented Dec 4, 2023

No description provided.

@fengmk2 fengmk2 added the enhancement New feature or request label Dec 4, 2023
@fengmk2
Copy link
Member Author

fengmk2 commented Dec 4, 2023

HttpClientConnectTimeoutError: Connect Timeout Error
    at #requestInternal (/Users/fengmk2/git/github.com/node-modules/urllib3/dist/commonjs/HttpClient.js:586:23)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async HttpClient.request (/Users/fengmk2/git/github.com/node-modules/urllib3/dist/commonjs/HttpClient.js:111:16)
    at async request (/Users/fengmk2/git/github.com/node-modules/urllib3/examples/timing.cjs:17:15) {
  status: -1,
  headers: {},
  socket: {
    id: 1,
    localAddress: '',
    localPort: 0,
    remoteAddress: '',
    remotePort: 0,
    remoteFamily: '',
    bytesWritten: 0,
    bytesRead: 0,
    handledRequests: 0,
    handledResponses: 0,
    connectErrorTime: 2023-12-04T09:58:38.294Z,
    attemptedRemoteAddresses: [ '67.228.102.32:443', '2a03:2880:f112:83:face:b00c:0:25de:443' ],
    connectProtocol: 'https:',
    connectHost: 'discord.com',
    connectPort: ''
  },
  res: {
    status: -1,
    statusCode: -1,
    statusText: '',
    headers: {},
    size: 0,
    aborted: false,
    rt: 1511.335,
    keepAliveSocket: true,
    requestUrls: [ 'https://discord.com/api/v10/users/@me?index=0' ],
    timing: {
      queuing: 1.725,
      connected: 0,
      requestHeadersSent: 0,
      requestSent: 0,
      waiting: 0,
      contentDownload: 0
    },
    socket: {
      id: 1,
      localAddress: '',
      localPort: 0,
      remoteAddress: '',
      remotePort: 0,
      remoteFamily: '',
      bytesWritten: 0,
      bytesRead: 0,
      handledRequests: 0,
      handledResponses: 0,
      connectErrorTime: 2023-12-04T09:58:38.294Z,
      attemptedRemoteAddresses: [ '67.228.102.32:443', '2a03:2880:f112:83:face:b00c:0:25de:443' ],
      connectProtocol: 'https:',
      connectHost: 'discord.com',
      connectPort: ''
    },
    retries: 0,
    socketErrorRetries: 0
  },
  code: 'UND_ERR_CONNECT_TIMEOUT',
  opaque: undefined,
  [cause]: ConnectTimeoutError: Connect Timeout Error
      at onConnectTimeout (/Users/fengmk2/git/github.com/node-modules/urllib3/node_modules/.store/[email protected]/node_modules/undici/lib/core/connect.js:186:24)
      at /Users/fengmk2/git/github.com/node-modules/urllib3/node_modules/.store/[email protected]/node_modules/undici/lib/core/connect.js:133:46
      at Immediate._onImmediate (/Users/fengmk2/git/github.com/node-modules/urllib3/node_modules/.store/[email protected]/node_modules/undici/lib/core/connect.js:174:9)
      at process.processImmediate (node:internal/timers:478:21) {
    code: 'UND_ERR_CONNECT_TIMEOUT'
  }
}

Copy link

codecov bot commented Dec 4, 2023

Codecov Report

Attention: 14 lines in your changes are missing coverage. Please review.

Comparison is base (fde0d23) 99.65% compared to head (90ae964) 98.76%.
Report is 1 commits behind head on master.

Files Patch % Lines
src/diagnosticsChannel.ts 87.50% 6 Missing ⚠️
src/HttpClientError.ts 85.29% 5 Missing ⚠️
src/HttpClient.ts 91.42% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #477      +/-   ##
==========================================
- Coverage   99.65%   98.76%   -0.89%     
==========================================
  Files           9       10       +1     
  Lines        1440     1542     +102     
  Branches      257      260       +3     
==========================================
+ Hits         1435     1523      +88     
- Misses          5       19      +14     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@fengmk2 fengmk2 marked this pull request as draft December 4, 2023 09:53
@fengmk2 fengmk2 marked this pull request as ready for review December 4, 2023 10:28
@fengmk2 fengmk2 merged commit 366de1d into master Dec 4, 2023
21 of 23 checks passed
@fengmk2 fengmk2 deleted the log-socket-info-on-connect-error branch December 4, 2023 12:27
fengmk2 pushed a commit that referenced this pull request Dec 4, 2023
[skip ci]

## [3.21.0](v3.20.0...v3.21.0) (2023-12-04)

### Features

* print more socket info on UND_ERR_CONNECT_TIMEOUT error ([#477](#477)) ([366de1d](366de1d))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant