Connect and share knowledge within a single location that is structured and easy to search. For more granular control, there are a number of other more specific timeouts you can set: As far as I can tell, there's no way to limit the time spent sending the request specifically. client.Timeout exceeded while awaiting headers - Stack Overflow Context Deadline Excceded (Client.Timeout exceeded while awaiting When we want to cancel the request, we cancel the Context by calling cancel() (instead of closing the Cancel channel): Contexts have the advantage that if the parent context (the one we passed to context.WithCancel) is canceled, ours will be, too, propagating the command down the entire pipeline. [Solved] Client timeout exceeded while awaiting headers error Get http://10.33.108.39:11222/index.php: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers). The "So you want to expose Go on the Internet" post has more information on server timeouts, in particular about HTTP/2 and Go 1.7 bugs. Well occasionally send you account related emails. Client.Timeout exceeded while awaiting headers #1534 To learn more about our mission to help build a better Internet, start here. Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support. to your account. For Linux systems I think the way to observe a potential disagreement between the libc hostname resolving (which could be consulting arbitrary data sources depending on /etc/nsswitch.conf) vs. the direct DNS resolving Terraform is effectively doing would be to compare the results of the following two commands: The first of these queries the libc resolver, which will hopefully use DNS indirectly, while the second will always use DNS. This is all. The time spent reading the request body can be controlled manually with a time.Timer since it happens after the Client method returns (see below for how to cancel a request). A server can use this header to ensure that a timely response is generated. Subscribe to receive notifications of new posts: Subscription confirmed. You can find similar issue reported here and here. Site design / logo 2023 Stack Exchange Inc; user contributions licensed under CC BY-SA.