[wp-trac] [WordPress Trac] #58202: php-fpm7.4: time limit exceeded `Operation canceled' @ fatal/cache.c/GetImagePixelCache/1868.

WordPress Trac noreply at wordpress.org
Wed Apr 26 19:23:49 UTC 2023


#58202: php-fpm7.4: time limit exceeded `Operation canceled' @
fatal/cache.c/GetImagePixelCache/1868.
--------------------------+-----------------------------
 Reporter:  dsar          |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Media         |    Version:  6.2
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 Since WordPress 6.2, I've been getting error - '' php-fpm7.4: time limit
 exceeded `Operation canceled' @ fatal/cache.c/GetImagePixelCache/1868.''
 regularly in the php-fpm error log, which also results in 503 error in
 Apache log.

 I believe this error is due to the new function set_imagick_time_limit()
 which uses Imagick::setResourceLimit() to set the time limit for Imagick
 processing to 80% of PHP's max_execution_time. Trac ticket: #52569


 It'd seem Imagick::setResourceLimit() sets the limit for not only the
 duration of the single request, but for as long as the parent Apache
 process is active. And if so, I'm also guessing the limit is applied and
 counted against all the processing done during all requests the parent
 Apache process handles.

 I tested this by creating 2 scripts:
 //imagickGet.php
 <?php
 $test = Imagick::getResourceLimit(Imagick::RESOURCETYPE_TIME);
 var_dump($test);
 var_dump(getmypid());

 //imagickSet.php
 <?php
 Imagick::setResourceLimit(Imagick::RESOURCETYPE_TIME, 17);
 var_dump(getmypid());


 Whenever I ran imagickSet.php once, any time I ran imagickGet.php I'd get
 17 as the limit (provided the same process handled the request, as
 reported by getmypid()).
 Tested on Apache 2.4.29, and PHP7.4.29.

 Is anyone else experiencing this issue?

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/58202>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list