Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Daemonize before loading environment #219

Conversation

eugeneius
Copy link
Contributor

Daemonizing forks the process, which kills all other running threads. If your Rails app starts threads during initialization, they will currently be killed almost immediately.

Sidekiq daemonizes before loading Rails:
https://github.com/mperham/sidekiq/blob/v4.1.2/lib/sidekiq/cli.rb#L42-L43
https://github.com/mperham/sidekiq/blob/v4.1.2/lib/sidekiq/cli.rb#L50

Daemonizing forks the process, which kills all other running threads. If
your Rails app starts threads during initialization, they will currently
be killed almost immediately.
@mariokostelac
Copy link
Contributor

mariokostelac commented Jun 6, 2016

I agree, writing PID and daemonizing are related just to the way we run some process. Sometimes they are even done by some external subject (like bash script doing that job). We should do that as soon as possible.

@mariokostelac mariokostelac merged commit ce6eeae into ruby-shoryuken:master Jun 6, 2016
mariokostelac added a commit that referenced this pull request Jun 8, 2016
mariokostelac added a commit that referenced this pull request Jun 8, 2016
mariokostelac pushed a commit that referenced this pull request Jun 8, 2016
phstc pushed a commit that referenced this pull request Sep 2, 2016
phstc added a commit that referenced this pull request Sep 2, 2016
* Fix auto extend error when using an ActiveJob wrapper

ActiveJob::QueueAdapters::ShoryukenAdapter::JobWrapper
Could not auto extend the message ActiveJob::QueueAdapters::ShoryukenAdapter::JobWrapper/<queue_name>/<message> visibility timeout. Error: undefined method `[]' for nil:NilClass

* Fix `Line is too long. [138/120]`

* Fix for `Align the operands of a condition in an "if statement" spanning multiple lines.`

* Fix initialization when the Load Rails option is specified

* Add rspec task

See https://www.relishapp.com/rspec/rspec-core/docs/command-line/rake-task.

* Fix NameError exception in AutoExtendVisibility

When execute command `bundle exec shoryuken -C config/shoryuken.yml --rails`.

> uninitialized constant Shoryuken::Middleware::Server::AutoExtendVisibility::MessageVisibilityExtender::Celluloid (NameError)

* Reduce shutdown wait time

* Run dispatch when processor done or dies

* Daemonize before loading environment

Daemonizing forks the process, which kills all other running threads. If
your Rails app starts threads during initialization, they will currently
be killed almost immediately.

* Document producer setup (#188)

* Add release date back on the change log

* Bump version to 2.0.7

* Add new author

* Load Celluloid before environment

* Bump version to 2.0.8

* Fix error when initialize shoryuken daemonize

* Fix daemonization broken in #219

* Bump version to 2.0.9

* Revert "Run dispatch when processor done or dies" (#226)

This reverts commit f4640d9.

* Bump version to 2.0.10

* I'm a completely stupid and removed the wrong version in rubygems

* Update CHANGELOG to add 2.0.11

* Minor sample default_worker cleanup

* Complementary fix for #213. Pass body to worker_name for calls from AutoExtendVisibility
@h3poteto h3poteto mentioned this pull request Dec 9, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants