[wp-trac] [WordPress Trac] #34796: Facing an issue when using wp_remote_get with streams (non-blocking mode)
WordPress Trac
noreply at wordpress.org
Thu Nov 26 22:45:08 UTC 2015
#34796: Facing an issue when using wp_remote_get with streams (non-blocking mode)
--------------------------+-----------------------------
Reporter: bangelov | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: HTTP API | Version: 4.3.1
Severity: normal | Keywords:
Focuses: |
--------------------------+-----------------------------
On some hosting providers (like wpengine.com) I've encountered an issue
when using wp_remote_get with streams (non-blocking mode) which on the
other hand uses PHP native functions stream_socket_client,
stream_context_create and stream_set_blocking. The issue is that HTTP
request (non-blocking) never succeed, it just hangs/stuck on the initial
call of stream_socket_client and neither errors or exception are
generated. I've investigated the issue deeper and it seems that many
people over the Internet have it. The issue can be resolved after invoking
stream_socket_client we put usleep(5000) and then
stream_set_blocking($handler, 0). It seems that the initial time for
stream_socket_client is not enough and that's why it needs more time in
order to process the HTTP request.
PHP Bugtracker
https://bugs.php.net/bug.php?id=64803
WordPress 4.3.1
PHP 5.5
Is it possible to add additinal parameter on wp_remote_get or if there is
any other way to achieve setting usleep parameter will help us to
precisely configure HTTP requests.
I am adding patch file
--
Ticket URL: <https://core.trac.wordpress.org/ticket/34796>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list