There is a call to curl_multi_exec in function purge_issue_requests_curl($purges) in purge.inc file. It fails with curl error code 0 and http error code 0. This is the code
***********************************
// Execute the purge requests
ob_start();
do {
$mrc = curl_multi_exec($curl_purges, $active);
} while ($mrc == CURLM_CALL_MULTI_PERFORM);
ob_end_clean();
**********************************
I think the problem is that the php script dies prematurely without allowing enough time for curl_multi_exec function to complete
I was able to fix the problem by adding following code to introduce some waiting period
***********************************
// Execute the purge requests
ob_start();
do {
$mrc = curl_multi_exec($curl_purges, $active);
} while ($mrc == CURLM_CALL_MULTI_PERFORM);
// new code starts
while ($active && $mrc == CURLM_OK) {
if (curl_multi_select($curl_purges) != -1) {
do {
$mrc = curl_multi_exec($curl_purges, $active);
} while ($mrc == CURLM_CALL_MULTI_PERFORM);
}
}
//new code ends
ob_end_clean();
***********************************
Above code snippet for curl wait period is copied from php.net documentation for curl_multi_exec
http://www.php.net/manual/en/function.curl-multi-exec.php# (see first example)
I can work on this if required.
Comments
Comment #1
delphian commentedThis can, depending on your box configuration, cause pages not to be purged. I had trouble with issuing purge requests to varnish due to this problem. After tracking it down and doing some more looking I found purge-6.x-1.5-rc1 exists but is not mentioned yet on the module page. (drush dl purge-6.x-1.5-rc1).
Comment #2
SqyD commentedTo clarify:
@delphian: Did 6.x-1.5rc1 fix this problem?
Comment #3
delphian commented@ SqyD: 6.x-1.5rc1 did fix the curl_multi_exec problem for me.
Comment #4
SqyD commented