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

Unexpected delays with got and unresolved host #2076

Closed
nordluf opened this issue Jul 6, 2022 · 1 comment
Closed

Unexpected delays with got and unresolved host #2076

nordluf opened this issue Jul 6, 2022 · 1 comment

Comments

@nordluf
Copy link

nordluf commented Jul 6, 2022

Describe the bug

  • Node.js version: v16.15.0
  • OS & version: Fedora release 35 (Thirty Five)
  • got version: 12.1.0

Actual behavior

$ time node 1.mjs 
Timeout awaiting 'lookup' for 100ms
Execution done: 128ms

real	0m4,115s
user	0m0,301s
sys	0m0,031s

After getting not existing host with got I face an unexpected delay before the script exits.

Expected behavior

Execution finishes without delays at the script end

Code to reproduce

const start = Date.now();

import got from 'got';

const timeout = {
  lookup: 100,
  connect: 50,
  secureConnect: 50,
  socket: 100,
  send: 100,
  response: 100
};
try {
  await got('http://notexists-host/with_some_url', { timeout, retry: { limit: 0 } });
} catch (err) {
  console.log(err.message);
}
console.log(`Execution done: ${Date.now() - start}ms`);

Checklist

  • [+] I have read the documentation.
  • [+] I have tried my code with the latest version of Node.js and Got.
@nordluf
Copy link
Author

nordluf commented Jul 12, 2022

Can't reproduce with node 16.16.0

@nordluf nordluf closed this as completed Jul 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant