Currently, Marathon issues unreserve calls for offers by simply reacting to observed spurious reservations in offers that belong to the Marathon instance (which is indicated by the reservation labels). This means that if we suppress offers, it could potentially take a long time to unreserve the resources for expunged resident tasks.
Two solutions exist for this problem:
- Explicitly revive if we know that there is some reservation that we need to unreserve (introduce an offer reservation tracker, or process based on instance/reservation goal)
- Directly issue an unreserve (and destroy volumes) command to the Mesos master using the Mesos HTTP API after the task is expunged and confirmed to be terminal.