HomePhorge

Prevent interruption by the PHP "set_time_limit()" mechanism while holding the…

Description

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

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.)

Maniphest Tasks: T13590

Differential Revision: https://secure.phabricator.com/D21526

Details

Provenance
epriestleyAuthored on Jan 26 2021, 3:54 PM
themackabuPushed on Mar 25 2025, 8:07 PM
Parents
rPda7d92dd0a4e: Catch more HTTP VCS errors and convert them into VCS repsonses
Branches
Unknown
Tags
Unknown

Event Timeline