[wp-trac] [WordPress Trac] #64080: WP_Upgrader doesn't release lock on create_lock

WordPress Trac noreply at wordpress.org
Mon Oct 20 11:40:47 UTC 2025


#64080: WP_Upgrader doesn't release lock on create_lock
-----------------------------+------------------------------
 Reporter:  skithund         |       Owner:  (none)
     Type:  defect (bug)     |      Status:  new
 Priority:  normal           |   Milestone:  Awaiting Review
Component:  Upgrade/Install  |     Version:  4.5
 Severity:  normal           |  Resolution:
 Keywords:  has-patch        |     Focuses:
-----------------------------+------------------------------
Changes (by skithund):

 * keywords:  has-patch has-unit-tests => has-patch


Comment:

 GitHub PR adds two tests for `create_lock()`, for the actual lock creation
 and another test for lock re-creation/expiration.

 Running the following would fail on current 6.8.3 WordPress install, since
 `create_lock()` wouldn't re-recreate the lock, which should've been
 "expired".

 After the patch, the lock would be recreated.
 {{{#!php
 <?php

 WP_Upgrader::create_lock( 'test' );
 sleep( 2 );
 $status = WP_Upgrader::create_lock( 'test', 1 );
 if ( false === $status ) {
   wp_die( 'Lock (re)creation failed' );
 }
 }}}

 We stumbled upon this bug due to erroneous code on our side, which fatal
 errored after creating the lock, but before running
 `WP_Upgrader::release_lock( 'test' );`, creating an infinite lock, even
 though the default lock "expiration" should be one hour.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/64080#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list