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
Unknown Object (File)
Mar 15 2024, 11:45 PM
Unknown Object (File)
Mar 12 2024, 8:14 PM
Unknown Object (File)
Jan 9 2024, 6:16 PM
Unknown Object (File)
Dec 27 2023, 1:40 PM
Unknown Object (File)
Dec 27 2023, 4:04 AM
Unknown Object (File)
Dec 22 2023, 3:28 AM
Unknown Object (File)
Dec 20 2023, 6:34 PM
Unknown Object (File)
Dec 15 2023, 8:39 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
Branch
http4
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 25046
Build 34559: Run Core Tests
Build 34558: arc lint + arc unit