[wp-trac] [WordPress Trac] #63547: wp_remote_post not respecting timeout & blocking params
WordPress Trac
noreply at wordpress.org
Mon Jun 9 09:38:41 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 b1ink0):
{{{
diff --git a/src/wp-includes/Requests/src/Transport/Curl.php b/src/wp-
includes/Requests/src/Transport/Curl.php
index 7316987b5f..1537014d91 100644
--- a/src/wp-includes/Requests/src/Transport/Curl.php
+++ b/src/wp-includes/Requests/src/Transport/Curl.php
@@ -424,7 +424,7 @@ final class Curl implements Transport {
// end, so we need to round up regardless of the supplied
timeout.
//
//
https://github.com/curl/curl/blob/4f45240bc84a9aa648c8f7243be7b79e9f9323a5/lib/hostip.c#L606-L609
- $timeout = max($options['timeout'], 1);
+ $timeout = max($options['timeout'], defined(
'CURL_VERSION_ASYNCHDNS' ) ? 0 : 1 );
if (is_int($timeout) || $this->version <
self::CURL_7_16_2) {
curl_setopt($this->handle, CURLOPT_TIMEOUT,
ceil($timeout));
}}}
After trying @siliconforks' suggestion about using
[https://php.watch/codex/CURL_VERSION_ASYNCHDNS], it seems to fix the
issue. Here is the result of running the test script from
https://core.trac.wordpress.org/ticket/63547#comment:3.
{{{
$ npm run env:cli -- eval-file src/wp-content/plugins/hello.php
'/?sleep=3'
> WordPress at 6.9.0 env:cli
> node ./tools/local-env/scripts/docker.js run --rm cli eval-file src/wp-
content/plugins/hello.php /?sleep=3
[+] Creating 2/2
✔ Container wordpress-develop-php-1 Running
0.0s
✔ Container wordpress-develop-mysql-1 Running
0.0s
Requested URL: http://localhost:8889/?sleep=3
Execution time: 0.0316 seconds
OK ✅
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/63547#comment:13>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list