Page MenuHomePhabricator

Prevent interruption by the PHP "set_time_limit()" mechanism while holding the durable write lock
ClosedPublic

Authored by epriestley on Jan 27 2021, 12:09 AM.
Tags
None
Referenced Files
F18784285: D21526.id51233.diff
Mon, Oct 13, 12:17 PM
F18754879: D21526.id51237.diff
Sun, Oct 5, 2:01 AM
F18694630: D21526.diff
Sat, Sep 27, 3:49 AM
F18571495: D21526.id51237.diff
Sep 10 2025, 5:04 AM
F18571492: D21526.id51233.diff
Sep 10 2025, 5:04 AM
F18219872: D21526.id51233.diff
Aug 19 2025, 12:49 PM
F18217861: D21526.id51237.diff
Aug 19 2025, 9:27 AM
F18194590: D21526.diff
Aug 17 2025, 11:05 AM
Subscribers
None

Details

Summary

Ref T13590. By default, PHP kills execution after web scripts run for 30 seconds. If this occurs in the locked section of a repository write while we're holding the durable write lock, the lock will get stuck.

Use "set_time_limit(0)" to prevent this mechanism from interrupting execution while the durable lock is held.

Test Plan
  • Added "set_time_limit(1)" before the lock and "while (1);" in the critical section of the lock.
  • Pushed, got the lock stuck.
  • Cleared the lock, applied this patch, pushed.
  • Got an infinite hang instead. (Normally, we expect the script to take more than 30 seconds to execute because there is a large push that executes in finite time, not because there's an infinte loop.)

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable