heat.engine.stack_lock module

class heat.engine.stack_lock.StackLock(context, stack_id, engine_id)[source]

Bases: object

acquire(retry=True)[source]

Acquire a lock on the stack.

Parameters:

retry (boolean) – When True, retry if lock was released while stealing.

get_engine_id()[source]

Return the ID of the engine which currently holds the lock.

Returns None if there is no lock held on the stack.

release()[source]

Release a stack lock.

thread_lock(retry=True)[source]

Acquire a lock and release it only if there is an exception.

The release method still needs to be scheduled to be run at the end of the thread using the Thread.link method.

Parameters:

retry (boolean) – When True, retry if lock was released while stealing.

try_acquire()[source]

Try to acquire a stack lock.

Don’t raise an ActionInProgress exception or try to steal lock.

try_thread_lock()[source]

Similar to thread_lock, but acquire the lock using try_acquire.

Only release it upon any exception after a successful acquisition.