Bug 1669973

Summary: Tasks cleanup rake tasks acts as an executor
Product: Red Hat Satellite Reporter: Adam Ruzicka <aruzicka>
Component: Tasks PluginAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED WORKSFORME QA Contact: Jan Hutaƙ <jhutar>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.4CC: andrew.schofield, aruzicka, inecas, ktordeur, pmoravec
Target Milestone: Unspecified   
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-01-30 11:24:05 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Adam Ruzicka 2019-01-28 09:24:19 UTC
Description of problem:
The foreman_tasks:cleanup rake task runs as an executor. This means that during the task cleanup the rake task can actually start processing satellite's tasks. When the rake task exits it may (or may not) leave the tasks it was processing in some kind of bad state (abnormal termination?).


Version-Release number of selected component (if applicable):
I'm not aware of any recent change which could introduce this behavior, this probably affects all satellite versions.

How reproducible:
Always


Steps to Reproduce:
1. Go into dynflow console
2. Run foreman_tasks:cleanup rake task
3. Keep refreshing the page until a new world record appears

Actual results:
The world used by the rake task appears under executor worlds

Expected results:
The world used by the rake task appears under client worlds

Additional info:

Comment 3 Ivan Necas 2019-01-29 11:21:09 UTC
Created redmine issue https://projects.theforeman.org/issues/25935 from this bug

Comment 4 Ivan Necas 2019-01-29 16:26:35 UTC
@Adam: with what version were you able to reproduce this? I'm not lucky with neither sat 6.3, 6.4 nor 6.5 in production. This code should make sure only db:migrate and db:seed are using their own executor

https://github.com/dynflow/dynflow/blob/fef5ca352fc90027440b159b9719a91ef1eb468a/lib/dynflow/rails/configuration.rb#L85

Comment 5 Adam Ruzicka 2019-01-29 17:43:21 UTC
I originally tested this from a git checkout in development environment and jumped to conclusions without verifying the behaviour in production. Now trying that in production I'm failing to reproduce the bug. So this is probably unrelated to the issues some of our customers are seeing. We can probably close the BZ, but I'd still keep the upstream issue around, even if just to bring the development environment's behaviour closer to production.

Comment 6 Ivan Necas 2019-01-30 11:24:05 UTC
Closing as it's actually not reproducible in production. After analyzing the data from the case, it most probably looks like hitting this BZ https://bugzilla.redhat.com/show_bug.cgi?id=1602110