dynflow 0.8.36 → 0.8.37
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 +4 -4
- data/doc/pages/source/404.md +1 -0
- data/doc/pages/source/_includes/menu.html +0 -1
- data/doc/pages/source/_includes/menu_right.html +1 -1
- data/doc/pages/source/documentation/index.md +1 -1
- data/lib/dynflow/delayed_executors/abstract_core.rb +4 -2
- data/lib/dynflow/execution_plan/hooks.rb +10 -6
- data/lib/dynflow/executors.rb +9 -0
- data/lib/dynflow/executors/parallel/worker.rb +3 -2
- data/lib/dynflow/rails.rb +1 -0
- data/lib/dynflow/rails/configuration.rb +1 -0
- data/lib/dynflow/transaction_adapters/abstract.rb +0 -6
- data/lib/dynflow/transaction_adapters/active_record.rb +0 -4
- data/lib/dynflow/version.rb +1 -1
- data/lib/dynflow/world.rb +7 -4
- data/test/daemon_test.rb +1 -0
- metadata +2 -4
- data/doc/pages/source/_drafts/2015-03-01-new-documentation.markdown +0 -10
- data/doc/pages/source/blog/index.html +0 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 07d302583997706186e5c5a55185a32b35757971615e5e42b73d9121cab2d23d
|
4
|
+
data.tar.gz: 9b5f20a8788784b95f4f52d66f3af1b7b1425f077a370b51a2e2ca2aed2b1c10
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3cd1c9ca74ab31c3afead86db86af7565c2f34e71c48d608d0dcac3ba105f0113fed48f9560865a3acced8545dd0daa55f7149311b91d81387b8ab00e2132aa8
|
7
|
+
data.tar.gz: 6fbf67d06c58b64076178aed4cd271d07d1ac89b5a6d962360dd140a63324c738552e74586d9d350e08216963ffa925cacffa53be45fb932ad9a982ada1b6bae
|
data/doc/pages/source/404.md
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
<!--TODO make active-->
|
2
2
|
<li><a href="/">About</a></li>
|
3
3
|
<li><a href="/documentation/">Documentation</a></li>
|
4
|
-
<li><a href="/blog/">Blog</a></li>
|
5
4
|
<li><a href="/faq/">FAQ</a></li>
|
6
5
|
<li><a href="/media/">Media</a></li>
|
7
6
|
<li><a href="/projects/">Related projects</a></li>
|
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
<!--<li><a class="extra" href="/atom.xml">RSS</a></li>-->
|
@@ -9,7 +9,7 @@ comments: true
|
|
9
9
|
{% danger_block %}
|
10
10
|
|
11
11
|
Work in progress! It contains a lot of tpyos, please let us know. There are comments at the bottom
|
12
|
-
or you can submit a PR against [
|
12
|
+
or you can submit a PR against [master branch](https://github.com/dynflow/dynflow/tree/master).
|
13
13
|
|
14
14
|
Please help with the documentation if you know Dynflow.
|
15
15
|
|
@@ -52,8 +52,10 @@ module Dynflow
|
|
52
52
|
plan.timeout
|
53
53
|
else
|
54
54
|
@logger.debug "Executing plan #{plan.execution_plan_uuid}"
|
55
|
-
|
56
|
-
|
55
|
+
Executors.run_user_code do
|
56
|
+
plan.plan
|
57
|
+
plan.execute
|
58
|
+
end
|
57
59
|
end
|
58
60
|
processed_plan_uuids << plan.execution_plan_uuid
|
59
61
|
end
|
@@ -60,12 +60,16 @@ module Dynflow
|
|
60
60
|
# @param action [Action] the action which triggered the hooks
|
61
61
|
# @param kind [Symbol] the kind of hooks to run, one of {HOOK_KINDS}
|
62
62
|
def run(execution_plan, action, kind)
|
63
|
-
on(kind)
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
63
|
+
hooks = on(kind)
|
64
|
+
return if hooks.empty?
|
65
|
+
Executors.run_user_code do
|
66
|
+
hooks.each do |hook|
|
67
|
+
begin
|
68
|
+
action.send(hook, execution_plan)
|
69
|
+
rescue => e
|
70
|
+
execution_plan.logger.error "Failed to run hook '#{hook}' for action '#{action.class}'"
|
71
|
+
execution_plan.logger.debug e
|
72
|
+
end
|
69
73
|
end
|
70
74
|
end
|
71
75
|
end
|
data/lib/dynflow/executors.rb
CHANGED
@@ -4,5 +4,14 @@ module Dynflow
|
|
4
4
|
require 'dynflow/executors/abstract'
|
5
5
|
require 'dynflow/executors/parallel'
|
6
6
|
|
7
|
+
# Every time we run a code that can be defined outside of Dynflow,
|
8
|
+
# we should wrap it with this method, and we can ensure here to do
|
9
|
+
# necessary cleanup, such as cleaning ActiveRecord connections
|
10
|
+
def self.run_user_code
|
11
|
+
yield
|
12
|
+
ensure
|
13
|
+
::ActiveRecord::Base.clear_active_connections! if defined? ::ActiveRecord
|
14
|
+
end
|
15
|
+
|
7
16
|
end
|
8
17
|
end
|
@@ -8,12 +8,13 @@ module Dynflow
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def on_message(work_item)
|
11
|
-
|
11
|
+
Executors.run_user_code do
|
12
|
+
work_item.execute
|
13
|
+
end
|
12
14
|
rescue Errors::PersistenceError => e
|
13
15
|
@pool.tell([:handle_persistence_error, e])
|
14
16
|
ensure
|
15
17
|
@pool.tell([:worker_done, reference, work_item])
|
16
|
-
@transaction_adapter.cleanup
|
17
18
|
end
|
18
19
|
end
|
19
20
|
end
|
data/lib/dynflow/rails.rb
CHANGED
@@ -10,12 +10,6 @@ module Dynflow
|
|
10
10
|
def rollback
|
11
11
|
raise NotImplementedError
|
12
12
|
end
|
13
|
-
|
14
|
-
# Called on each thread after work is done.
|
15
|
-
# E.g. it's used to checkin ActiveRecord connections back to pool.
|
16
|
-
def cleanup
|
17
|
-
# override if needed
|
18
|
-
end
|
19
13
|
end
|
20
14
|
end
|
21
15
|
end
|
data/lib/dynflow/version.rb
CHANGED
data/lib/dynflow/world.rb
CHANGED
@@ -42,10 +42,8 @@ module Dynflow
|
|
42
42
|
@executor_dispatcher = spawn_and_wait(Dispatcher::ExecutorDispatcher, "executor-dispatcher", self, config_for_world.executor_semaphore)
|
43
43
|
executor.initialized.wait
|
44
44
|
end
|
45
|
-
if auto_validity_check
|
46
|
-
|
47
|
-
self.locks_validity_check
|
48
|
-
end
|
45
|
+
perform_validity_checks if auto_validity_check
|
46
|
+
|
49
47
|
@delayed_executor = try_spawn(config_for_world, :delayed_executor, Coordinator::DelayedExecutorLock)
|
50
48
|
@execution_plan_cleaner = try_spawn(config_for_world, :execution_plan_cleaner, Coordinator::ExecutionPlanCleanerLock)
|
51
49
|
@meta = config_for_world.meta
|
@@ -337,6 +335,11 @@ module Dynflow
|
|
337
335
|
logger.error "failed to write data while invalidating execution lock #{execution_lock}"
|
338
336
|
end
|
339
337
|
|
338
|
+
def perform_validity_checks
|
339
|
+
worlds_validity_check
|
340
|
+
locks_validity_check
|
341
|
+
end
|
342
|
+
|
340
343
|
def worlds_validity_check(auto_invalidate = true, worlds_filter = {})
|
341
344
|
worlds = coordinator.find_worlds(false, worlds_filter)
|
342
345
|
|
data/test/daemon_test.rb
CHANGED
@@ -16,6 +16,7 @@ class DaemonTest < ActiveSupport::TestCase
|
|
16
16
|
@world_class = mock('dummy world factory')
|
17
17
|
@dummy_world = ::Dynflow::Testing::DummyWorld.new
|
18
18
|
@dummy_world.stubs(:auto_execute)
|
19
|
+
@dummy_world.stubs(:perform_validity_checks)
|
19
20
|
@event = Concurrent.event
|
20
21
|
@dummy_world.stubs(:terminated).returns(@event)
|
21
22
|
@world_class.stubs(:new).returns(@dummy_world)
|
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: 0.8.
|
4
|
+
version: 0.8.37
|
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: 2018-03-
|
12
|
+
date: 2018-03-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: multi_json
|
@@ -252,7 +252,6 @@ files:
|
|
252
252
|
- doc/pages/plugins/toc.rb
|
253
253
|
- doc/pages/source/.nojekyll
|
254
254
|
- doc/pages/source/404.md
|
255
|
-
- doc/pages/source/_drafts/2015-03-01-new-documentation.markdown
|
256
255
|
- doc/pages/source/_includes/disqus.html
|
257
256
|
- doc/pages/source/_includes/google_analytics.html
|
258
257
|
- doc/pages/source/_includes/google_plus_one.html
|
@@ -344,7 +343,6 @@ files:
|
|
344
343
|
- doc/pages/source/_sass/bootstrap/mixins/_text-overflow.scss
|
345
344
|
- doc/pages/source/_sass/bootstrap/mixins/_vendor-prefixes.scss
|
346
345
|
- doc/pages/source/atom.xml
|
347
|
-
- doc/pages/source/blog/index.html
|
348
346
|
- doc/pages/source/bootstrap/config.json
|
349
347
|
- doc/pages/source/bootstrap/css/bootstrap-theme.css
|
350
348
|
- doc/pages/source/bootstrap/css/bootstrap-theme.min.css
|