[wp-trac] [WordPress Trac] #63547: wp_remote_post not respecting timeout & blocking params
WordPress Trac
noreply at wordpress.org
Mon Jun 9 07:13:13 UTC 2025
#63547: wp_remote_post not respecting timeout & blocking params
--------------------------+--------------------------
Reporter: mihai200 | Owner: westonruter
Type: defect (bug) | Status: accepted
Priority: normal | Milestone: 6.9
Component: HTTP API | Version: 4.6
Severity: normal | Resolution:
Keywords: | Focuses: performance
--------------------------+--------------------------
Comment (by siliconforks):
It seems like the issue here is that the timeout is not allowed to be less
than one second - if the requested timeout is less than that, it is
increased to one second anyway:
https://github.com/WordPress/wordpress-
develop/blob/7d5fb7b4a98a4ac02ef0d7b354f11b1396363d51/src/wp-
includes/Requests/src/Transport/Curl.php#L427
From the preceding comment it appears that this is done to work around a
problem with cURL when using the system DNS resolver. However, it also
says that "There's no way to detect which DNS resolver is being used" -
but this does not seem to be true any more since PHP 7.3 was released with
the [https://php.watch/codex/CURL_VERSION_ASYNCHDNS
CURL_VERSION_ASYNCHDNS] constant. So I think it would be possible to
allow timeouts of less than one second for systems with
`CURL_VERSION_ASYNCHDNS`.
Someone actually suggested this a long time ago -
https://github.com/WordPress/Requests/issues/264 - but then it appears
that the conversation wandered off into other topics and the original
suggestion was never implemented...
--
Ticket URL: <https://core.trac.wordpress.org/ticket/63547#comment:12>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list