Repository navigation
Fix the garbage collection for orquesta workflow executions - #4733
Conversation
In the query to identify task executions, add id__ne filter so that the action execution for the workflow execution is not included. This fixes the case where there is no task executions for the workflow execution. If there are task executions for the workflow execution, fix the if statement that identifies if there is any active tasks and if there are not active tasks whether the most recently completed task has passed expiry datetime.
Orphaned workflow executions are not common. Disable this gc feature by default and let users knowingly enable it.
|
Please note that there are existing unit tests covering this feature @ https://github.com/StackStorm/st2/blob/master/st2common/tests/unit/services/test_workflow_identify_orphans.py. Once the logic in the if statement was changed, these tests failed. Adding the additional filter |
| retry_wait_fixed_msec = 1000 | ||
| # Max seconds to allow workflow execution be idled before it is identified as orphaned and cancelled by the garbage collector. | ||
| gc_max_idle_sec = 900 | ||
| # Max seconds to allow workflow execution be idled before it is identified as orphaned and cancelled by the garbage collector. A value of zero means the feature is disabled. This is disabled by default. |
There was a problem hiding this comment.
Looks like a better/safer default 👍
|
Can you please point me to an explicit test case which checks that nothing is deleted / marked as canceled when config option is set to Aka in addition to testing the default value, also having an explicit test case which tests with Besides that, the change looks good to me. |
Add unit tests to test whether the garbage collection for canceling orphaned workflow executions is disabled by setting gc_max_idle_sec to zero.
|
@Kami Unit tests added to address your concerns. Note, the garbage collector service has zero unit tests for other gc routines. I only added tests to cover the issue here. |
|
Merging to have it in master/packages ASAP |
Fix logic in identifying orphaned workflow executions which causes long running workflow executions to be canceled. Disable this garbage collection feature for orphaned workflow executions by default.