mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-10 08:52:39 +01:00
Throw a richer exception when updating tasks with expired leases
Summary: Include task ID and class when raising this exception. I took a brief stab at doing this generically, but (a) we specifically raise this exception outside of normal try/catch because we can't follow normal recovery rules for it and (b) we don't have a reasonable PhutilProxyException or similar right now which would preserve stack traces, and don't have builtin exception nesting support until PHP 5.3. Test Plan: Faked this exception, verified we get more information in the logs. Reviewers: btrahan, vrana Reviewed By: btrahan CC: aran Maniphest Tasks: T2193 Differential Revision: https://secure.phabricator.com/D4205
This commit is contained in:
parent
09f543e2e2
commit
4c7c518c63
1 changed files with 4 additions and 1 deletions
|
@ -55,7 +55,10 @@ final class PhabricatorWorkerActiveTask extends PhabricatorWorkerTask {
|
|||
if ($this->leaseOwner) {
|
||||
$current_server_time = $this->serverTime + (time() - $this->localTime);
|
||||
if ($current_server_time >= $this->leaseExpires) {
|
||||
throw new Exception("Trying to update task after lease expiration!");
|
||||
$id = $this->getID();
|
||||
$class = $this->getTaskClass();
|
||||
throw new Exception(
|
||||
"Trying to update Task {$id} ({$class}) after lease expiration!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue