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

Requests hangs with cacheable-request and keepalive agent on Node 14 for some URLs #1522

Closed
2 tasks done
adityapatadia opened this issue Nov 11, 2020 · 6 comments
Closed
2 tasks done
Labels
bug Something does not work as it should ✭ help wanted ✭

Comments

@adityapatadia
Copy link

Describe the bug

  • Node.js version: 14.15
  • OS & version: Macos 10.15

Actual behavior

Got never responds and gets stuck somewhere. Program execution never moves ahead.

Expected behavior

Got should fire proper response

Code to reproduce

const got = require("got"),
  http = require("http"),
  https = require("https");

const agent = {
  http: new http.Agent({ keepAlive: true }),
  https: new https.Agent({ keepAlive: true })
};

var requestOptions = {
  timeout: 35000, // milliseconds
  responseType: 'buffer',
  retry: 0,
  maxRedirects: 5,
  dnsCache: false,
  shared: false,
  // this code works if below argument is commented.
  agent,
  cache: new Map()
};

(async () => {
  const response = await got.get("https://www.lttc.ntu.edu.tw/eju.htm?fill=solid&v=8", requestOptions);
  // below line line never gets printed....
  console.log("response received");
})();

Checklist

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

I should also mention this happens only with Node 14 and everything works fine under Node 12.

@szmarczak
Copy link
Collaborator

What about Node.js 15?

@adityapatadia
Copy link
Author

Does not work on 15.

@szmarczak szmarczak added bug Something does not work as it should ✭ help wanted ✭ labels Nov 11, 2020
@szmarczak
Copy link
Collaborator

Hmm... Works on v13.14.0... Investigating.

@szmarczak
Copy link
Collaborator

After some investigation I have come to a conclusion that this is a duplicate of #1385 (I first wasn't initially really sure how to reproduce the issue, so thanks for this report!)

@szmarczak
Copy link
Collaborator

#1385 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something does not work as it should ✭ help wanted ✭
Projects
None yet
Development

No branches or pull requests

2 participants