1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-24 07:42:40 +01:00
phorge-phorge/src/applications/drydock
epriestley 4dd32dca3e When a Drydock Blueprint promises us a resource but can't deliver, continue believing in it
Summary:
Ref T13073. When a Blueprint says it will be able to allocate a resource but then throws an exception while attempting that allocation, we currently fail the lease permanently.

This is excessively harsh. This blueprint may have the best of intentions and have encountered a legitimately unforseeable failure (like a `vm.new` call to build a VM failed) and be able to succeed in the future.

Even if this blueprint is a dirty liar, other blueprints (or existing resources) may be able to satisfy the lease in the future.

Even if every blueprint is implemented incorrectly, leaving the lease alive lets it converge to success after the blueprints are fixed.

Instead of failing, log the issue and yield.

(In the future, it might make sense to distinguish more narrowly between "actually, all the resources are used up" and all other failure types, since the former is likely more routine and less concerning.)

Test Plan:
  - Wrote a broken `Hoax` blueprint which always claims it can allocate but never actually allocates (just `throw` in `allocateResource()`).
  - Used `bin/phd drydock lease` to acquire a Hoax lease.
  - Before patch: lease abruptly failed permanently.
  - After patch: lease yields after allocation fails.

{F5427747}

Subscribers: PHID-OPKG-gm6ozazyms6q6i22gyam

Maniphest Tasks: T13073

Differential Revision: https://secure.phabricator.com/D19070
2018-02-13 13:11:55 -08:00
..
application Unprototype Drydock 2016-03-04 17:23:07 -08:00
blueprint Fix spelling 2017-10-09 10:48:04 -07:00
capability Give Drydock resources a proper expiry mechanism 2015-09-28 09:35:14 -07:00
conduit Allow "drydock.blueprint.edit" to create blueprints 2018-01-04 10:08:07 -08:00
constants Modernize Drydock SearchEngine implementations 2015-09-24 09:56:49 -07:00
controller Modularize transactions for Drydock Blueprints 2018-01-04 10:03:44 -08:00
customfield Convert DrydockBlueprints to EditEngine 2016-03-03 15:21:25 -08:00
editor Allow "drydock.blueprint.edit" to create blueprints 2018-01-04 10:08:07 -08:00
exception Improve Drydock errors for empty commits and missing changes 2016-03-07 05:29:25 -08:00
garbagecollector Provide bin/garbage for interacting with garbage collection 2015-10-02 09:17:24 -07:00
interface Make WorkingCopyBlueprint responsible for performing merges 2015-10-26 12:40:16 -07:00
logtype When a Drydock Blueprint promises us a resource but can't deliver, continue believing in it 2018-02-13 13:11:55 -08:00
management Fix 4 typos in code 2017-04-07 04:09:56 -07:00
operation Reduce callsites to "ArcanistDifferentialRevisionStatus" in Phabricator 2017-08-09 11:04:52 -07:00
phid Mark PhabricatorPHIDType::getPHIDTypeApplicationClass() as abstract 2015-11-03 06:47:12 +11:00
query Expose Drydock authorizations via Conduit 2016-10-11 19:55:43 +00:00
storage Modularize transactions for Drydock Blueprints 2018-01-04 10:03:44 -08:00
typeahead Render browse results with global result style 2016-06-20 16:49:02 -07:00
view Convert Drydock to two column layout 2016-03-13 08:10:36 -07:00
worker When a Drydock Blueprint promises us a resource but can't deliver, continue believing in it 2018-02-13 13:11:55 -08:00
xaction Allow "drydock.blueprint.edit" to create blueprints 2018-01-04 10:08:07 -08:00