Bug #20908

Postpone the initialization of dynflow

Added by Ivan Necas 13 days ago. Updated 13 days ago.

Status:Closed
Priority:High
Assigned To:Ivan Necas
Category:-
Target version:-
Difficulty: Bugzilla link:
Found in release: Pull request:https://github.com/theforeman/foreman/pull/4826
Story points-
Velocity based estimate-
Release1.16.0Release relationshipAuto

Description

In #18618, the initialization code was moved from foreman-tasks to foreman. There was however one
thing done differently, where the initialization of dynflow world was moved directly to the
time `Rails.application.dynflow` was called. This is not right, as there are situations where
plugins go and call `Rails.application.dynflow.config` before the whole stack is prepared, which leads to
database connection being opened too early, which can cause the whole lot of issues (as we've hit currently with Katello).

After we released #18673, the Katello tests started failing on

ActiveRecord::StatementInvalid: PG::ObjectInUse: ERROR:  database "test_develop_pr_katello-2-test" is being accessed by other users
DETAIL:  There are 3 other sessions using the database.

That was due to fact that the dynflow world was initialized too early.


Related issues

Related to Foreman - Feature #18618: Use Dynflow as an ActiveJob backend Closed 02/22/2017
Related to foreman-tasks - Bug #18673: Remove initialization code in favor of Dynflow Closed 02/24/2017

Associated revisions

Revision 0f225c99
Added by Ivan Necas 13 days ago

Fixes #20908 - postpone initialization of Dynflow runtime

In #18618, the initialization code was moved from foreman-tasks to
foreman. There was however one thing done differently, where the
initialization of dynflow world was moved directly to the time
`Rails.application.dynflow` was called. This is not right, as there are
situations where plugins go and call `Rails.application.dynflow.config`
before the whole stack is prepared, which leads to database connection
being opened too early, which can cause the whole lot of issues (as
we've hit currently with Katello).

There was also change in the signature of `Dynflow::Rails#initialize`
method, that needs to be updated.

History

#1 Updated by Ivan Necas 13 days ago

  • Release set to 1.16.0

We should handle this before 1.16 gets out

#2 Updated by Ivan Necas 13 days ago

  • Related to Feature #18618: Use Dynflow as an ActiveJob backend added

#3 Updated by Ivan Necas 13 days ago

  • Related to Bug #18673: Remove initialization code in favor of Dynflow added

#4 Updated by The Foreman Bot 13 days ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/4826 added

#5 Updated by Ivan Necas 13 days ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

Also available in: Atom PDF