Renat Akhmerov 3d7acd3957 Improve workflow completion logic by removing periodic jobs
* Workflow completion algorithm use periodic scheduled jobs to
  poll DB and determine when a workflow is finished. The problem
  with this approach is that if Mistral runs another iteration
  of such job too soon then running such jobs will create a big
  load on the system. If too late, then a workflow may be in
  RUNNING state for too long after all its tasks are completed.
  The current implementation tries to predict a delay with which
  the next job should run, based on a number of incompleted tasks.
  This approach was initially taken because we switched to a
  non-blocking transactional model (previously we locked the entire
  workflow execution graph in order to change a state of anything)
  and in this architecture, when we have parallel branches, i.e.
  parallel DB transactions, we can't make a consistent read from
  DB from neither of these transactions to make a reliable decision
  about whether the workflow is completed or not. Using periodic
  jobs was a solution. However, this approach has been proven to
  work unreliably because such a prediction about delay before the
  next job iteration doesn't work well on all variety of use cases
  that we have.
  This patch removes using periodic jobs in favor of using the
  "two transactions" approach when in the first transaction we
  handle action completion event (and task completion if it causes
  it) and in the second transaction, if a task is completed, we
  check if the workflow is completed. This approach guarantees
  that at least one of the "second" transactions in parallel
  branches will make needed consistent read from DB (i.e. will
  see the actuall state of all needed objects) to make the right
  decision.

Closes-Bug: #1799382
Change-Id: I2333507503b3b8226c184beb0bd783e1dcfa397f
2018-11-07 04:00:04 +00:00
2018-01-31 04:16:42 +00:00
2018-10-19 10:45:29 +02:00
2018-08-01 05:08:48 +00:00
2018-05-30 14:46:25 -04:00
2017-07-27 22:15:12 +08:00
2013-12-30 13:11:49 +07:00
2017-03-03 10:17:44 +00:00
2018-10-19 10:45:29 +02:00

Team and repository tags

image

Mistral

Workflow Service for OpenStack cloud. This project aims to provide a mechanism to define tasks and workflows without writing code, manage and execute them in the cloud environment.

Project Resources

Description
Workflow Service for OpenStack.
Readme 51 MiB
Languages
Python 99%
Shell 1%