HTTP API Fallover & non-blocking order doesnt appear to be working
|Reported by:||DD32||Owned by:||jacobsantos|
|Severity:||normal||Keywords:||has-patch tested 2nd-opinion|
It seem that the _getTransport() and _postTransport() functions are not falling over to the next available transport upon error, As the If block only ever matches a single transport.
That also has the effect of the non-blocking priority list being useless since which ever transport is matched, will be the only one available.
attached patch changes it to test each object, This could have a negitive downside of making requests take even longer in cases where Slowdowns are being experienced (ie. 4x 2second delays, 1 for each transport instead of only 1x 2second delay)
Perhaps some caching needs to be done to not use a transport if its failed in the last 12 hours, Much like the fsockopen class attempts to do.
array 0 => & object(WP_Http_Curl) transports: WP_Http_Curl Requesting http://dd32.id.au/ using WP_Http_Curl took 0.000sWP_Http_Curl has failed with error:test
(curl::request returning a dummy error object, in reality, if it fails, it'll be timing out after 2-4 seconds)
(Aside: I believe this is the root issue on #8590, as it'll attempt to fire cron on every page load, and doesnt appear to be going into non-blocking mode in the details on that ticket)
array 0 => & object(WP_Http_Curl) 1 => & object(WP_Http_Streams) 2 => & object(WP_Http_Fopen) 3 => & object(WP_Http_Fsockopen) transports: WP_Http_Curl, WP_Http_Streams, WP_Http_Fopen, WP_Http_Fsockopen Requesting http://dd32.id.au/ using WP_Http_Curl took 0.001sWP_Http_Curl has failed with error:test Requesting http://dd32.id.au/ using WP_Http_Streams took 0.710sWP_Http_Streams has failed with error:Could not open handle for fopen() to http://dd32.id.au/ Requesting http://dd32.id.au/ using WP_Http_Fopen took 1.214s
(thats a var_dump of the available transports at the start there)
jacobsantos: Any feedback?
Change History (29)
- Keywords needs-patch added; has-patch needs-testing removed
- Milestone changed from 2.8 to Future Release
- Keywords has-patch tested added; needs-patch removed
- Owner set to jacobsantos
- Status changed from new to accepted
- Resolution invalid deleted
- Status changed from closed to reopened