Warm tip: This article is reproduced from stackoverflow.com, please click
http httpserver timeout

Does a server continue processing a HTTP request after the client's timeout is over?

发布于 2020-04-04 10:15:16

If I set a 100ms timeout to a HTTP request and the server needs 5s to process this request, does it stop after 100ms or the server completes its calculations and then tries to respond afer 5s?

I have searched for documentation but I have not found anything. Maybe an obvious question or bad search.

Questioner
Gonz
Viewed
86
Alexey R. 2020-02-01 00:10

The standard says that:

When a client or server wishes to time-out it SHOULD issue a graceful close on the transport connection. Clients and servers SHOULD both constantly watch for the other side of the transport close, and respond to it as appropriate. If a client or server does not detect the other side's close promptly it could cause unnecessary resource drain on the network

In the real life you should distinguish the logic that implements HTTP standard and the logic that implements a business feature. Will the business logic still be processing after the HTTP server detected that the connection has been closed depends on how the server is implemented, how the business logic is implemented and how wverything is integrated into each other.