Commit Graph

7 Commits (4a500125b350b46dee0d3c9f01c3cac7223d9c80)

Author SHA1 Message Date
Zane Bitter e56fc689e1 Increase the timeout for the stop_stack message
Previously, the stop_stack message accidentally used the
engine_life_check_timeout (by default, 2s). But unlike other messages sent
using that timeout, stop_stack needs to synchronously kill all running
threads operating on the stack. For a very large stack, this can easily
take much longer than a couple of seconds. This patch increases the timeout
to give a better chance of being able to start the delete.

Change-Id: I4b36ed7f1025b6439aeab63d71041bb2000363a0
Closes-Bug: #1499669
7 years ago
Steve Baker 3000f90408 Legacy delete attempt thread cancel before stop
The error messages 'Command Out of Sync' are due to the threads being
stopped in the middle of the database operations. This happens in the
legacy action when delete is requested during a stack create.

We have the thread cancel message but that was not being used in this
case. Thread cancel should provide a more graceful way of ensuring the
stack is in a FAILED state before the delete is attempted.

This changes does the following in the delete_stack service method for
legace engine:
- if the stack is still locked, send thread cancel message
- in a subthread wait for the lock to be released, or until a
  timeout based on the 4 minute cancel grace period
- if the stack is still locked, do a thread stop as before

Closes-Bug: #1499669
Closes-Bug: #1546431
Closes-Bug: #1536451
Change-Id: I4cd613681f07d295955c4d8a06505d72d83728a0
7 years ago
Steve Baker 9e007acc44 Add context to stack lock function arguments
Context is added as the first argument to stack_lock_* db functions
but is currently ignored for getting the session used for stack lock
operations.

This is required later for bug 1479723 but is added in its own change
here to ease reviewing load.

Change-Id: Ieb3e4e2ee67150777cbe1e961d0d1806cf1f7e46
Related-Bug: #1479723
7 years ago
Rabi Mishra ef4cf621fb Move some functions to service_utils
This moves some utility functions to service_utils
from stack_lock.

Change-Id: Iebc39a7f7b15dd5eea4be3cd3fdaea22607dd72e
7 years ago
ricolin 220e44a3ac Use EntityNotFound instead of StackNotFound.
replace and remove StackNotFound

Change-Id: I0bf4e35e4acf8bcfdd933c7fb862c63f7550f6c2
Partial-Bug: #1515603
8 years ago
Steve Baker 44b2f0965d Reset stack status even when lock engine_id is None
Having a stack which is wedged UPDATE_IN_PROGRESS due to another bug,
restarting heat-engine should have resulted in the stack being reset to
UPDATE_FAILED. However the reset was skipped because the lock engine_id
was None.

This change removes the engine_id check since it is possible in practice
for an UPDATE_IN_PROGRESS stack to not be locked.

Since it is possible for the stack to change state in the unlocked
window, a check is added that the stack is still IN_PROGRESS before the
reset is performed.

Change-Id: I1739ccbdf75af35aac5be16b99200975df58b8e2
Closes-Bug: #1514615
8 years ago
tengqm e8a777fd1a Split engine service test cases (8)
This patch splits the stack watch related unit tests into a separate
module. Some mox calls are replaced with mock calls where approriate.

It also moves the existing modules related to engine service tests
into a separate subdirectory. This is to make room for other unit
tests that are coming in.

Change-Id: I7ea61c22e017785c480d78d6c07132164ed0b889
8 years ago