HomePhabricator

When a lease acquires a resource but the resource fails to activate, throw the…

Description

When a lease acquires a resource but the resource fails to activate, throw the lease back in the pool

Summary:
Depends on D19075. Ref T13073. If a lease acquires a resource but finds that the resource builds directly into a dead state (which can happen for any number of reasonable reasons), reset the lease and throw it back in the pool.

This isn't the lease's fault and it hasn't caused any side effects or done anything we can't undo, so we can safely reset it and throw it back in the pool.

Test Plan:

  • Created a blueprint which throws from allocateResource() so that resources never activate.
  • Tried to lease it with bin/drydock lease ....
  • Before patch: lease was broken and destroyed after a failed activation.
  • After patch: lease was returned to the pool after a failed activation.

Subscribers: PHID-OPKG-gm6ozazyms6q6i22gyam

Maniphest Tasks: T13073

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