-
-
Notifications
You must be signed in to change notification settings - Fork 751
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Scheduler bounces LiveActions between delayed and policy-delayed #4655
Comments
Thanks for reporting this. This indeed looks like a bug / race. @m4dcoder will you have time to have a look this / next week (since you are the last person who worked on that and probably have the most context , otherwise I can have a look as well). |
This is not a race. It's more of an annoying behavior. We introduced policy-delayed when we refactored the scheduler. An action execution goes to policy-delayed when the concurrency policy enforce delay for the execution. When the scheduler sees the policy enforcement, it delays the execution. In this case, the execution are being delayed and rescheduled and delayed again by policy. We can refactor the scheduler/policies to reduce and silence the effect. |
This is not a bug either to be precise. Is it performing the way it's suppose to? Did the concurrency policy delayed the action execution? The behavior of having many status change recorded in the object can be categorized as annoying. |
@m4dcoder i found this behavior when debugging an issue where a bunch of our actions were stuck in a |
I was able to reproduce this issue, at least the flipping back and forth between Even if the end result and policies work correctly, this flipping back and forth is not desired, especially because on each of the state change we need to update execution object ( Example output: st2 execution get 5cd14ac40761292469c559aa --attr log
log: - status: requested
timestamp: '2019-05-07T09:07:16.000000Z'
- status: policy-delayed
timestamp: '2019-05-07T09:07:16.000000Z'
- status: delayed
timestamp: '2019-05-07T09:07:16.000000Z'
- status: policy-delayed
timestamp: '2019-05-07T09:07:18.000000Z'
- status: delayed
timestamp: '2019-05-07T09:07:18.000000Z'
- status: policy-delayed
timestamp: '2019-05-07T09:07:20.000000Z'
- status: delayed
timestamp: '2019-05-07T09:07:20.000000Z'
- status: policy-delayed
timestamp: '2019-05-07T09:07:22.000000Z'
- status: delayed
timestamp: '2019-05-07T09:07:22.000000Z'
- status: policy-delayed
timestamp: '2019-05-07T09:07:24.000000Z'
- status: delayed
timestamp: '2019-05-07T09:07:24.000000Z'
- status: policy-delayed
timestamp: '2019-05-07T09:07:26.000000Z'
- status: delayed
timestamp: '2019-05-07T09:07:26.000000Z'
- status: policy-delayed
timestamp: '2019-05-07T09:07:28.000000Z'
- status: delayed
timestamp: '2019-05-07T09:07:28.000000Z'
... It could cause very massive execution objects for executions which are delayed for longer time periods (it flips status back and forth around every two seconds which is the And it also generates tons of (unnecessary) log traffic in st2scheduler. EDIT: Actual policies itself seem to work correctly, but this flipping back and forth still needs to be addressed. |
SUMMARY
I noticed this when debugging another problem and wanted to say something in case this behavior wasn't intended.
When there are executions that are
delayed
by a policy, thest2scheduler
is constantly flipping them betweenpolicy-delayed
anddelayed
state. Each state change is accumulated in theLiveAction
instance and causes fairly large objects, especially if executions are delayed for a long period of time (large backlog).ISSUE TYPE
STACKSTORM VERSION
OS / ENVIRONMENT / INSTALL METHOD
STEPS TO REPRODUCE
Create the following policy `/opt/stackstorm/packs/default/policies/core_local_concurrency.yaml
Run the following script to kick off a bunch of
core.local
excutionsTail the
st2scheduler
logsACTUAL RESULTS
The text was updated successfully, but these errors were encountered: