Closed richardartoul closed 1 year ago
I realized that there is no need to add explicit timeouts in the header. Currently, we already perform HTTP requests with timeouts on the client side. Therefore, on the server side, instead of creating a separate context with timeout, we can leverage the Context
that is attached to every http.Request
. By using the request's context, when the timeout is reached, the client will automatically cancel the HTTP connection. As a result, the corresponding request context on the server side will also be canceled, ensuring timely termination of the request processing. This approach allows us to utilize the existing request context and its built-in cancellation mechanism, rather than creating a separate timeout value.
We lose the context deadlines when we go over the network with the HTTP client. We should propagate it as a header