dynflow 1.6.8 → 1.6.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e8f8620a4de5e01dbd253d659f07f4221a41a88112c7ca9b1440591bfc0a7b2f
4
- data.tar.gz: 13d941834dc18889bef6c0bf8bee95f5286104974fa0ded2bb9a5ffda6f6ea81
3
+ metadata.gz: db2725603e440298025d434778ebf2e218e6c3e30fb7db07aaddea80648cbb2d
4
+ data.tar.gz: 4d8003de94bec301bd411c1c3ee92df9e1d10cc45bc36d4d843a75c2eb664171
5
5
  SHA512:
6
- metadata.gz: f84d05b76492e25562a8cb06628bfd69f8d7f5a28b62d9bdd97469db206c8d0378209609376283c21fa664a7b13587df1babc828f92f15e58e95fe5ad411a85c
7
- data.tar.gz: fbb2db621fb8903f314cb061258230b5c0567c4aaf6beb8e051027f4206c2a14ed2c734b90160437060c5fa36823c7febb946d7b41d5d974d798b58410e083e5
6
+ metadata.gz: ab0fa706aa8b41c1197aef44bf57a87f4e5c37d7d343a9ca7e83e20af8de89b4e0fb2e72e7a1b93fffa05ac3265c78a48d598d7b8e0292785cd2276057edd0f0
7
+ data.tar.gz: 07e82b78806a61511b0ddff0240dd596172dfe79735bc8b931d7972b4d322d29bca1686be8be0087a105171e7348c0ee24cfdb2b01cc1a8dcf8d97ad8b0134c8
@@ -167,7 +167,7 @@ module Dynflow
167
167
  @logger = world.logger
168
168
  @execution_plan_managers = {}
169
169
  @rescued_steps = {}
170
- @planning_plans = []
170
+ @planning_plans = Set.new
171
171
  end
172
172
 
173
173
  def current_execution_plan_ids
@@ -175,6 +175,8 @@ module Dynflow
175
175
  end
176
176
 
177
177
  def handle_planning(execution_plan_uuid)
178
+ return [] if @planning_plans.include? execution_plan_uuid
179
+
178
180
  @planning_plans << execution_plan_uuid
179
181
  [PlanningWorkItem.new(execution_plan_uuid, :default, @world.id)]
180
182
  end
@@ -85,6 +85,9 @@ module Dynflow
85
85
  logger.info('Performing validity checks')
86
86
  @world.perform_validity_checks
87
87
  logger.info('Finished performing validity checks')
88
+ if @world.delayed_executor && !@world.delayed_executor.started?
89
+ @world.delayed_executor.start
90
+ end
88
91
  @recovery = false
89
92
  end
90
93
 
@@ -393,11 +393,11 @@ module Dynflow
393
393
  hash = if record[:data].nil?
394
394
  SERIALIZABLE_COLUMNS.fetch(what, []).each do |key|
395
395
  key = key.to_sym
396
- record[key] = MessagePack.unpack((record[key])) unless record[key].nil?
396
+ record[key] = MessagePack.unpack(record[key].to_s) unless record[key].nil?
397
397
  end
398
398
  record
399
399
  else
400
- MessagePack.unpack(record[:data])
400
+ MessagePack.unpack(record[:data].to_s)
401
401
  end
402
402
  Utils.indifferent_hash(hash)
403
403
  end
@@ -152,6 +152,9 @@ module Dynflow
152
152
  # we can't do any operation until the Rails.application.dynflow.world is set
153
153
  config.auto_execute = false
154
154
  config.auto_validity_check = false
155
+ if sidekiq_worker? && !Sidekiq.options[:queues].include?("dynflow_orchestrator")
156
+ config.delayed_executor = nil
157
+ end
155
158
  end
156
159
  end
157
160
 
data/lib/dynflow/rails.rb CHANGED
@@ -46,6 +46,9 @@ module Dynflow
46
46
  invalidated_worlds = world.perform_validity_checks
47
47
  world.auto_execute
48
48
  world.post_initialization if invalidated_worlds > 0
49
+ if @world.delayed_executor && !@world.delayed_executor.started?
50
+ @world.delayed_executor.start
51
+ end
49
52
  config.run_post_executor_init_hooks(world)
50
53
  end
51
54
  end
@@ -5,7 +5,7 @@ module Dynflow
5
5
  extend Mimic
6
6
  mimic! World
7
7
 
8
- attr_reader :clock, :executor, :middleware, :coordinator
8
+ attr_reader :clock, :executor, :middleware, :coordinator, :delayed_executor
9
9
  attr_accessor :action
10
10
 
11
11
  def initialize(_config = nil)
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Dynflow
3
- VERSION = '1.6.8'
3
+ VERSION = '1.6.11'
4
4
  end
data/lib/dynflow/world.rb CHANGED
@@ -77,7 +77,7 @@ module Dynflow
77
77
  @delayed_executor ||= try_spawn(:delayed_executor, Coordinator::DelayedExecutorLock)
78
78
  @execution_plan_cleaner ||= try_spawn(:execution_plan_cleaner, Coordinator::ExecutionPlanCleanerLock)
79
79
  update_register
80
- @delayed_executor.start if @delayed_executor && !@delayed_executor.started?
80
+ @delayed_executor.start if auto_validity_check && @delayed_executor && !@delayed_executor.started?
81
81
  self.auto_execute if @config.auto_execute
82
82
  end
83
83
 
@@ -464,6 +464,27 @@ module Dynflow
464
464
  loaded_plan = adapter.load_execution_plan(plan[:id])
465
465
  assert_equal_attributes!(plan_data, loaded_plan)
466
466
  end
467
+
468
+ it 'does not leak Sequel blobs' do
469
+ db = adapter.send(:db)
470
+ # Prepare records for saving
471
+ plan = prepare_plans.first
472
+
473
+ value = 'a' * 1000
474
+
475
+ adata = action_data.merge({:output => { :key => value }})
476
+ plan_record = adapter.send(:prepare_record, :execution_plan, plan.merge(:uuid => plan[:id]))
477
+ action_record = adapter.send(:prepare_record, :action, adata.dup)
478
+
479
+ # Insert the records
480
+ db[:dynflow_execution_plans].insert plan_record.merge(:uuid => plan[:id])
481
+ db[:dynflow_actions].insert action_record.merge(:execution_plan_uuid => plan[:id], :id => adata[:id])
482
+
483
+ # Load the saved records
484
+ loaded_action = adapter.load_action(plan[:id], adata[:id])
485
+ _(loaded_action[:output][:key].class).must_equal String
486
+ _(loaded_action[:output][:key]).must_equal value
487
+ end
467
488
  end
468
489
  end
469
490
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dynflow
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.8
4
+ version: 1.6.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ivan Necas
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2022-12-06 00:00:00.000000000 Z
12
+ date: 2023-05-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: multi_json
@@ -678,7 +678,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
678
678
  - !ruby/object:Gem::Version
679
679
  version: '0'
680
680
  requirements: []
681
- rubygems_version: 3.3.20
681
+ rubygems_version: 3.4.12
682
682
  signing_key:
683
683
  specification_version: 4
684
684
  summary: DYNamic workFLOW engine