Curl_multi loop failures

Created on 10 July 2017, over 7 years ago
Updated 16 May 2023, over 1 year ago

We've created a plugin to clear caches in Fastly CDN. This seems to have identified a situation where the requestsExecute() function loops thru executing curl_multi_exec causing an endless loop each time a queue item is processed. Eventually the host memory is exhausted in this circumstance.

Details at http://php.net/manual/en/function.curl-multi-exec.php

There is a comment by Ren which explains an alternative way to execute the curl_multi_exec() function.

Solve CPU 100% usage, a more simple and right way:


do {
    curl_multi_exec($mh, $running);
    curl_multi_select($mh);
} while ($running > 0);

The attached patch seems to solve this.

πŸ› Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States selwynpolit

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024