7.10.3. Lifecycle

The lifecycle of instances is directed by a system of leases and sponsors. A lease specifies the minimum time an instance should exist. When the lease expires, sponsors of the instance are queried whether they want to renew the lease. When the lease is not renewed, the instance can be reclaimed by the garbage collector. By default, an instance gets an initial lease of 5 minutes and no sponsor, leases can be set and sponsors registered programmatically.

Note that the fact that sponsors are queried makes it possible to only query one of potentially many live sponsors of an instance at the time of lease expiration.