[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#976811: [pkg-php-pear] Bug#976811: transition: php8.1




Hi,

On 1/19/22 14:08, Bryce Harrington wrote:
On Wed, Jan 19, 2022 at 09:58:52PM +0100, Paul Gevers wrote:
Hi Bryce,

On 19-01-2022 10:28, Bryce Harrington wrote:

With [4] applied, I'm seeing the following dumped on armhf:

## https://autopkgtest.ubuntu.com/packages/m/mediawiki/jammy/armhf
cat: /var/log/mediawiki/error.log: No such file or directory
2022-01-19 09:16:57 autopkgtest-lxd-eeoxik autopkgtestwiki: [e33d1ec89af515673078437e] /mediawiki/index.php/Main_Page   PHP Fatal Error from line 110 of /usr/share/mediawiki/includes/json/FormatJson.php: Maximum execution time of 30 seconds exceeded
#0 [internal function]: MWExceptionHandler::handleFatalError()
#1 {main}
2022-01-19 09:17:27 autopkgtest-lxd-eeoxik autopkgtestwiki: [1284cbae5a84eb5387f33003] /mediawiki/index.php/Main_Page   PHP Fatal Error from line 152 of /usr/share/mediawiki/includes/HookContainer/HookContainer.php: Maximum execution time of 30 seconds exceeded
#0 [internal function]: MWExceptionHandler::handleFatalError()
#1 {main}
2022-01-19 09:17:57 autopkgtest-lxd-eeoxik autopkgtestwiki: [31731278ed6070e946af4fbe] /mediawiki/index.php/Main_Page   PHP Fatal Error from line 110 of /usr/share/mediawiki/includes/json/FormatJson.php: Maximum execution time of 30 seconds exceeded
#0 [internal function]: MWExceptionHandler::handleFatalError()
#1 {main}
cat: /var/log/mediawiki/fatal.log: No such file or directory

Thanks for applying the patch and testing it!

As this issue seems intermittent (as mediawiki passed at one point) I guess
you're trying to say that you think mediawiki got slower with php8.1? Or is
this timeout new with php8.1?

The failing cases are mostly ones with triggers for
php-defaults/84~0ubuntu1 or newer, which marks where php8.1 is set as
default.  The ones that pass and don't specify that are thus running
php8.0.  So it looks like the pass-vs-fail correlates to php8.0-vs-8.1
and is something specific to armhf.

Unfortunately I don't have i386 builds to compare with (due to
dependency issues), so it's just a hunch that this is the same problem
Debian sees on i386.  It'd be illuminating to doublecheck on your i386
builds that it's also hitting this same timeout situation.

Obviously the code that fails to finish is mediawiki's code, so it
doesn't seem to be a generic issue with php8.1 except if the timeout
happens because of something inside php8.1.

Line 110 that the error points to appears to be a json_encode() call.

Can anybody shed a light on if it's reasonable to time out on what
mediawiki is trying to do here. And why doesn't it happen on other
architectures (in Debian, as far as I checked)?

MediaWiki is just loading the page, which in theory should be cheap (<1s), but since it's the first page load it will be filling empty caches and running background tasks which could be expensive. When I grepped for FormatJson::encode, I came up with SpecialRunJobs (background tasks) and MessageBlobStore (caching) as code paths that would get hit, and both have the potential to be slow/add extra time to page loads.

I can't tell what it may be trying to encode, but presumably it's either
Main_Page or something used by Main_Page, which I'm guessing should only
take a fraction of a second to encode.  I suppose we could test
increasing max_execution_time.  But my suspicion is that the encoder is
getting stuck in a loop or a recursion.

30 seconds seems a bit absurd, but given an empty opcache/jit, empty caches, on 32-bit VMs, it's within the realm of possibility...I think bumping max_execution_time is a good next step. Should the test add a php.ini snippet or something?

I read through the 8.1 changelog (<https://www.php.net/ChangeLog-8.php#PHP_8_1>) and couldn't find anything relevant that wasn't already in PHP 8.0.8 (specifically <https://github.com/php/php-src/commit/bf9dc534356ec3b372abe5f3030c3e362aa261ac> looked suspect, but that was included in 8.0.7).

Just to give some expectations, I won't have time to dig into this until the weekend. I did drop a pointer to the bug in the MediaWiki developers IRC channel in case anyone there had suggestions.

-- Kunal


Reply to: