Scheduler delay is not configurable

Bug #1721733 reported by Renat Akhmerov
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mistral
Fix Released
High
Renat Akhmerov

Bug Description

When we run Mistral in HA every engine instance runs its own Scheduler thread that processes delayed calls. These calls are important part of the entire workflow processing. All these schedulers often compete each other badly because try to process same calls stored in DB. In case of using MySql it often leads to deadlocks which doesn't mean that we use some bad patterns, it's just Mysql behaviour, it's described in their docs that such situations may occur and developers need to design applications taking this into account.

One simple solution that would help reduce contention between Scheduler instances is to:
1) Make delay between Scheduler iterations configurable so that if it's needed we could make it bigger and reduce number of DB hits
2) Add the random part in Scheduler delay to distribute Scheduler iterations more evenly in time which also should reduce contention and load to DB.

Changed in mistral:
milestone: none → queens-1
importance: Undecided → High
status: New → Confirmed
assignee: nobody → Renat Akhmerov (rakhmerov)
Changed in mistral:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to mistral (master)

Reviewed: https://review.openstack.org/510010
Committed: https://git.openstack.org/cgit/openstack/mistral/commit/?id=f6b6f1d20b84853dc900004425b8f98a296ce7f1
Submitter: Jenkins
Branch: master

commit f6b6f1d20b84853dc900004425b8f98a296ce7f1
Author: Renat Akhmerov <email address hidden>
Date: Fri Oct 6 13:16:11 2017 +0700

    Make scheduler delay configurable

    * Made scheduler delay configurable. It now consists of a fixed
      part configured with the 'fixed_delay' property and a random
      addition limited by the 'random_delay' config property.
      Because of this, using loopingcall from oslo was replaced with
      a regular loop in a separate thread becase loopingcall
      supports only fixed delays.

    Closes-Bug: #1721733
    Change-Id: I8f6a15be339e208755323afb18e4b58f886770c1

Changed in mistral:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to mistral (stable/pike)

Fix proposed to branch: stable/pike
Review: https://review.openstack.org/511389

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on mistral (stable/pike)

Change abandoned by Renat Akhmerov (<email address hidden>) on branch: stable/pike
Review: https://review.openstack.org/511389

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to mistral (stable/pike)

Reviewed: https://review.openstack.org/511389
Committed: https://git.openstack.org/cgit/openstack/mistral/commit/?id=f9129b702d5fe3a5247223c3e2d89ef39aedc60c
Submitter: Jenkins
Branch: stable/pike

commit f9129b702d5fe3a5247223c3e2d89ef39aedc60c
Author: Renat Akhmerov <email address hidden>
Date: Fri Oct 6 13:16:11 2017 +0700

    Make scheduler delay configurable

    * Made scheduler delay configurable. It now consists of a fixed
      part configured with the 'fixed_delay' property and a random
      addition limited by the 'random_delay' config property.
      Because of this, using loopingcall from oslo was replaced with
      a regular loop in a separate thread becase loopingcall
      supports only fixed delays.

    Closes-Bug: #1721733
    Change-Id: I8f6a15be339e208755323afb18e4b58f886770c1

tags: added: in-stable-pike
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/mistral 6.0.0.0b1

This issue was fixed in the openstack/mistral 6.0.0.0b1 development milestone.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/mistral 5.2.0

This issue was fixed in the openstack/mistral 5.2.0 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.