Skip to content

[5.x]: CP hangs on license check #15643

@ul8

Description

@ul8

What happened?

Description

As previously reported in #15571, if there are connection issues to the license API, the CP hangs. It's now been reduced to 15 seconds (thanks!), but the problem could probably be eliminated altogether. Here's a suggestion by our hosting provider:

It seems the PHP process with the curl_exec holds a lock during the blocking request, which other PHP processes then have to wait for and are thus delayed for just as long as the curl_exec.

The most likely candidate would be the session lock:
https://stackoverflow.com/a/38217390/1563584

(Detailed explanation of session locks:
https://ma.ttias.be/php-session-locking-prevent-sessions-blocking-in-requests/)

The best solution would be that Craft should not start a session in the license check,
or end/close the session before the request to the license server...

Steps to reproduce

  1. On OS level, simulate that the Craft API server cannot be reached (timeout)
  2. Access the CP repeatedly (logged in)

Expected behavior

Normal performance

Actual behavior

The CP hangs up to the 15 second timeout since 5.3.5 / 4.11.4, or to curl's default timeout otherwise.

Craft CMS version

5.3.5

PHP version

8.3

Operating system and version

No response

Database type and version

No response

Image driver and version

No response

Installed plugins and versions

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions