DEV Community

Alex Rudenko
Alex Rudenko

Posted on

How do you handle client timeouts?

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?

Discussion (0)