How do you handle client timeouts?

twitter logo github logo ・1 min read

You have an endpoint which does some valuable computations, and it's supposed to answer within say 3000 ms. Therefore, the client has 3000 ms as the timeout setting for the request. For whatever reason, some % of requests started to take 6000ms. What happens now is that execution continues after the client disconnects. The result is then just discarded.

The question is: how do you deal with it (if at all) using your current technology? Do you abort the computations and how do you do it?

twitter logo DISCUSS
Classic DEV Post from Nov 1 '19

Do developers have higher job satisfaction than non-developers?

Alex Rudenko profile image
About me: software developer who is into JavaScript and NodeJS and constantly working on one or another side project and/or open source. I have a blog at https://alex-rudenko.com