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

WordPress Trac noreply at wordpress.org
Mon Oct 27 16:07:07 UTC 2025


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

Comment (by skithund):

 And I'm having really hard time wrapping my head around the original
 problem and reproduction due to working on thousand and one things after
 this. I'm 99% sure that the PHPUnit tests I wrote were failing too, but
 yes, that's impossible 🫠

 The original problem is/was that we use
 `WP_Upgrader::create_lock('our_sync');` to create a lock for an hourly
 scheduled event, where we sync data from an ERP to WordPress. Due to not
 accounting for connection errors, when connecting to ERP, our code exited,
 not going through the full sync process and running
 `WP_Upgrader::release_lock('our_sync');` at the end - leaving the lock in
 the database.

 The scheduled event then ran every hour, but failed to create lock, even
 though it should "release" itself after the default one hour timeout in
 `WP_Upgrader::create_lock();`

 I'll try to look into this again possibly tomorrow.

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


More information about the wp-trac mailing list