Bug #38546
openAsync Repository::CapsuleSync tasks that don't find any relevant proxies to sync sometimes end up in failing state
Description
This is not systematically reproducible, but we have seen it happen on different systems using various Katello versions.
It only appears to affect the Repository::CapsuleSync action when the following conditions are met:
- The action is planned as an async task (using ForemanTasks.async_task)
- The repo in question is associated with an environment not used by any proxy (the action is essentially a noop).
The symptoms are:
- The dynflow task reports success on all steps almost instantly.
- The foreman task does not update to result=success, it stays in pending for ages and eventually (at latest after restarting Foreman) reports result=error.
Since the task was not actually meant to do anything, nothing is actually broken, but users are confused by the failed tasks.
I have no idea what exactly is causing this, some possible ideas:
- Starting several Repository::CapsuleSync tasks in close proximity.
- Perhaps something with resource locks?
- Perhaps it is a problem that the task does almost nothing and finishes to quickly?
Proposed fix:
It is relatively simple to check if there are any smart proxies using the relevant environment and making the ForemanTasks.async_task call conditional on this.
This way we don't run the unneeded noop async tasks at all.
This fixes the issue regardless of the underlying cause and has the added benefit of having less useless tasks in the task list.
Updated by The Foreman Bot 2 days ago
- Status changed from New to Ready For Testing
- Pull request https://github.com/Katello/katello/pull/11433 added
Updated by The Foreman Bot 1 day ago
- Pull request https://github.com/Katello/katello/pull/11407 added