FusionAuth / fusionauth-typescript-client

A TypeScript client for FusionAuth
https://fusionauth.io
Apache License 2.0
60 stars 27 forks source link

Add a default timeout that isn't 0 for requests #92

Open theogravity opened 6 months ago

theogravity commented 6 months ago

For the current version of node-fetch that the client uses, the default timeout is 0 (OS-dependent). We're noticing our service that only makes calls to fusion auth go to 100% CPU usage at times and can't tell if it's due to requests getting stuck in flight because of the lack of a timeout.

For systems like Linux, the timeout is usually 3 minutes, which is way too long IMO.

https://stackoverflow.com/questions/1045964/how-to-view-change-socket-connection-timeout-on-linux

https://github.com/node-fetch/node-fetch/tree/2.x?tab=readme-ov-file#options