chaps-io / gush

Fast and distributed workflow runner using ActiveJob and Redis
MIT License
1.03k stars 103 forks source link

unable to run #36

Closed steveburkett closed 7 years ago

steveburkett commented 7 years ago

hi there, noob question.

I have set up gush inside my rails4 project. I attempt to start! (3 times), but i the workflow seems stuck in :running, and i'm not sure what's happening with it.

(1) set up test workflow (below). (2) I started the 'be gush workers' (and i see sidekiq started with the 'gush' queue) (3) in a rails console, i

test = GushTestWorkflow.new
test.start!
test.status ( = :running)
[ruby-2.3.3]sb/sidekiq-concurrent-queues:datawarehouse $ bundle exec gush list
+--------------------------------------+------------------+----------------+
|                  id                  |       name       |     status     |
+--------------------------------------+------------------+----------------+
| 924986e4-116f-4ce3-bc74-be445c08f9e4 | GushTestWorkflow | ready to start |
| b0eab0c9-3427-4666-8f9f-85a0b49400a3 | GushTestWorkflow | ready to start |
| f6b30370-b5f8-406c-910c-e5142716dd9a | GushTestWorkflow | ready to start |
+--------------------------------------+------------------+----------------+
class GushTestWorkflow < Gush::Workflow
  def configure
    run GushTestSeqJob, before: [GushTestParallelJob]

    run GushTestParallelJob, after: GushTestSeqJob

    run GushTestSeqJob, after: [GushTestParallelJob]
  end
end
class GushTestSeqJob < Gush::Job
  def work
    Rails.logger.debug("Running TestSeqJob. #{params} - TID #{Thread.current.object_id.to_s(36)}")
    sleep 45
    Rails.logger.debug("Running TestSeqJob #{params} - TID #{Thread.current.object_id.to_s(36)}")
  end
end
class GushTestParallelJob < Gush::Job
  def work
    Rails.logger.debug("Running TestParallelJob #{params} - TID #{Thread.current.object_id.to_s(36)}")
    sleep 45
    Rails.logger.debug("Running TestParallelJob #{params} - TID #{Thread.current.object_id.to_s(36)}")
  end
end
krzyzak commented 7 years ago

Hi Steve,

First of all, your workflow looks quite strange - you'd like to run a GushTestSeqJob both before and after GushTestParallelJob - I assume that's just for sake of an example.

Going back to the original issue, if a workflow has ready to start status, it means that the worker didn't pick up the job. Please make sure that the be gush workers command is up&running in the same time that you're trying to start your workflow first. If that still won't help, make sure that your redis server is working correctly, and you passed correct credentials (if set). In case that it still won't help, please provide an example app we could clone&check