Urgent.News

What's breaking now, across hundreds of outlets.

Tech

Schema migrations in WordPress that never take your site down

One morning in October we deployed a new version of one of our plugins. A few minutes later the site stopped answering. Not slow: stopped. Every PHP worker was busy, every new request queued behind them, and the only way out was restarting PHP. The cause was four lines of code that almost every WordPress plugin has in some form: add_action ( 'plugins_loaded' , function ( ) { if ( get_option (…

In October, deploying a new version of a plugin led to the entire site becoming inoperable. Each PHP worker became occupied, requests were queued behind them, and the only recourse was to restart PHP. The root cause was four lines of code common in WordPress plugins: checking the plugin's database version on the 'plugins_loaded' hook and updating it if necessary.

This approach proved hazardous for a high-traffic website, as running the migration check on every request caused multiple instances of the ALTER TABLE operation to collide. One succeeded, while another failed due to a duplicate column name. Furthermore, an ALTER TABLE operation faced a metadata lock, preventing new queries from running on the affected table.

MySQL's default lock_wait_timeout is set to one year, causing all workers to become stuck and waiting for the deadlock to resolve. The post explains the dangers of this pattern and presents a new solution that prevents site downtime during deployments.

Rewritten by urgent.news; may contain errors — check the original.

Source: dev.to

Read the original at dev.to →

Report a problem with this story

More in Tech

SBF Analyzer Front End Gain (AGC): Check SBF Logs and Find Antenna or Interference Problems

SBF Analyzer answers two questions about any recorded Septentrio SBF file: which SBF blocks it actually contains , and whether the receiver's RF front end was healthy while the file was being logged .

  • SBF Analyzer checks blocks and receiver RF front end health
  • AGC readings 15–50 dB healthy, above 50 dB too little gain
  • Net gain at antenna input calculated by subtracting AGC gain from 65 dB

More from Saturday, 28 November 2026 →