Fix compute next time in green thread of trigger
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Karbor |
Fix Released
|
High
|
zengchen |
Bug Description
Time trigger computes next time in the green thread as following codes.
1 def _trigger_
2 now = datetime.utcnow()
3 if expect_run_time > now and (
4 int(timeutils.
5 return expect_run_time
6 return self._compute_
7 datetime.utcnow(), trigger_
8 trigger_
9 trigger_
A bug will happen on the following step:
1. 'now' < 'expect_run_time ' and 'expect_run_time' - 'now' < 1(second) on line 3 4
2. the next run time returned on line 6 may still equal to parameter 'expect_run_time'
if sending operations to executor quickly so that 'datetime.utcnow()' on
line 7 less than 'expect_run_time'. If this happens, then '_trigger_
be invoked immediately.
Changed in karbor: | |
assignee: | nobody → zengchen (chenzeng2) |
Changed in karbor: | |
importance: | Undecided → High |
milestone: | none → ocata |
Fix proposed to branch: master /review. openstack. org/400083
Review: https:/