Lease (computer Science)
   HOME

TheInfoList



OR:

In
computer science Computer science is the study of computation, automation, and information. Computer science spans theoretical disciplines (such as algorithms, theory of computation, information theory, and automation) to Applied science, practical discipli ...
, a Lease is a contract that gives its holder specified rights to some resource for a limited period. Because it is time-limited, a lease is an alternative to a
lock Lock(s) may refer to: Common meanings *Lock and key, a mechanical device used to secure items of importance *Lock (water navigation), a device for boats to transit between different levels of water, as in a canal Arts and entertainment * ''Lock ...
for resource
serialization In computing, serialization (or serialisation) is the process of translating a data structure or object state into a format that can be stored (e.g. files in secondary storage devices, data buffers in primary storage devices) or transmitted (e ...
.


Motivation

A traditional resource lock is granted until it is explicitly released by the locking client process. Reasons why a lock might not be released include: * The client failed before releasing the resources * The client deadlocked while attempting to allocate another resource * The client was blocked or delayed for an unreasonable period * The client neglected to free the resource, perhaps due to a bug * The request to free the resource was lost * The resource manager failed or lost track of the resource stated Any of these could end the availability of an important reusable resource until the system is reset. By contract, a lease is valid for a limited period, after which it automatically expires, making the resource available for reallocation by a new client.


History

The term 'lease' was applied to this concept in a 1989 paper by Cary G. Gray and David R. Cheriton, but similar concepts (expiring tokens and breakable locks with timeouts) had been used in prior systems.


Problems

Leases are commonly used in distributed systems for applications ranging from DHCP address allocation to
file locking File locking is a mechanism that restricts access to a computer file, or to a region of a file, by allowing only one user or process to modify or delete it at a specific time and to prevent reading of the file while it's being modified or deleted ...
, but they are not (by themselves) a complete solution: * There must be some means of notifying the lease holder of the expiration and preventing that agent from continuing to rely on the resource. Often, this is done by requiring all requests to be accompanied by an
access token In computer systems, an access token contains the security credentials for a login session and identifies the user, the user's groups, the user's privileges, and, in some cases, a particular application. In some instances, one may be asked to ente ...
, which is invalidated if the associated lease has expired. * If a lease is revoked after the lease holder has started operating on the resource, revocation may leave the resource in a compromised state. In such situations, it is common to use
Atomic transaction In database systems, atomicity (; from grc, ἄτομος, átomos, undividable) is one of the ACID (''Atomicity, Consistency, Isolation, Durability'') transaction properties. An atomic transaction is an ''indivisible'' and ''irreducible'' se ...
s to ensure that updates that do not complete have no effect.


References

{{Reflist Concurrency control