• Hi after latest update to 4.9.0 I observe regular issues with deadlocks:

    WordPress database error Deadlock found when trying to get lock; try restarting transaction for query DELETE FROM XXX_postmeta WHERE post_id = 1 AND meta_key = 'wpdesk_migration_XXXXXXXXXXXXXXXXXXX' AND CAST(CASE WHEN LOCATE('|', meta_value) > 0 THEN SUBSTRING_INDEX(meta_value, '|', -1) ELSE SUBSTRING_INDEX(meta_value, '_', -1) END AS UNSIGNED) < UNIX_TIMESTAMP() made by require('wp-blog-header.php'), require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), do_action('init'), WP_Hook->do_action, WP_Hook->apply_filters, WPDesk\ShopMagic\Plugin->WPDesk\ShopMagic\{closure}, do_action('shopmagic/core/initialized/v2'), WP_Hook->do_action, WP_Hook->apply_filters, WPDesk\ShopMagicCart\Plugin->WPDesk\ShopMagicCart\{closure}, ShopMagicVendor\WPDesk\Migrations\WpdbMigrator->migrate, ShopMagicVendor\WPDesk\Mutex\WordpressPostLease->acquireLock, ShopMagicVendor\WPDesk\Mutex\WordpressPostLease->deleteExpiredLocks


    PHP Fatal error: Uncaught ShopMagicVendor\WPDesk\Mutex\MutexException: Unable to clean expired post leases. Deadlock found when trying to get lock; try restarting transaction in /XXX/public_html/wp-content/plugins/shopmagic-for-woocommerce/vendor_prefixed/wpdesk/wp-mutex/src/WPDesk/Mutex/WordpressPostLease.php:158
Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter Tomasz Dziuda

    (@dziudek)

    FYI – I have temporary solved this issue by replacing:

    public function migrate(): void
    {
    require_once \ABSPATH . 'wp-admin/includes/upgrade.php';
    $mutex = $this->mutex;
    if (!$mutex->acquireLock()) {

    With:

    public function migrate(): void
    {
    require_once \ABSPATH . 'wp-admin/includes/upgrade.php';

    // patch start
    if (!$this->needs_migration()) {
    $this->migration_error_notice->clear();
    return;
    }
    // patch end

    $mutex = $this->mutex;
    if (!$mutex->acquireLock()) {
    Plugin Support krzysztofskorupa

    (@krzysztofskorupa)

    Hi,

    thank you very much for reaching out.

    Does this issue also occur in the previous version of ShopMagic?

    If I understand correctly, the problem only appeared in the latest version, is that right?

    Best regards,

    Thread Starter Tomasz Dziuda

    (@dziudek)

    @krzysztofskorupa – yes, this issue was introduced in v.4.9.0

    Plugin Support krzysztofskorupa

    (@krzysztofskorupa)

    Hi, thanks for the confirmation.

    I’ve forwarded this thread to our team for review and likely a fix.

    For now, I recommend reverting to the previous version (since the error wasn’t present there) or using the fix you noticed.

    I’ll let you know when a new version is released or when I hear back from the developer.

    Best regards,

    Plugin Support krzysztofskorupa

    (@krzysztofskorupa)

    Hi, thank you for your patience.
    Here: https://wordpress.org/plugins/shopmagic-for-woocommerce/advanced/znajdziesz version 4.9.1 Beta

    I would appreciate it if you could test it to see if it resolves the reported issue.
    I look forward to hearing from you.
    Best regards,

Viewing 5 replies - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.