Dynflow / dynflow

DYNamic workFLOW orchestration engine
http://dynflow.github.io
MIT License
121 stars 44 forks source link

Throttle limiter assumes a single process environment #415

Open adamruzicka opened 2 years ago

adamruzicka commented 2 years ago

Steps to reproduce: 1) Apply the attached patch[1] 2) Make all processes use the same DB by setting DB_CONN_STRING env variable 3) Run an orchestrator bundle exec sidekiq -c 1 -q dynflow_orchestrator -r ./examples/remote_executor.rb 4) Run a worker bundle exec sidekiq -c 5 -q default -r ./examples/remote_executor.rb 5) Run another worker bundle exec sidekiq -c 5 -q default -r ./examples/remote_executor.rb 6) Trigger the bug bundle exec ruby examples/remote_executor.rb client

The job will most likely fail with the following

undefined method `wait' for nil:NilClass (NoMethodError)
lib/dynflow/throttle_limiter.rb:71:in `block (2 levels) in handle_plans'
lib/dynflow/throttle_limiter.rb:69:in `tap'
lib/dynflow/throttle_limiter.rb:69:in `block in handle_plans'
lib/dynflow/throttle_limiter.rb:68:in `map'
lib/dynflow/throttle_limiter.rb:68:in `handle_plans'
[ concurrent-ruby ]
lib/dynflow/throttle_limiter.rb:21:in `handle_plans!'
lib/dynflow/action/with_sub_plans.rb:92:in `trigger_with_concurrency_control'
lib/dynflow/action/with_sub_plans.rb:82:in `trigger'

If not, stop all the processes, recreate the database and try again.

[1] - 0001-Reproducer-for-bug-with-concurrency-control-with-mul.patch