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

son-gtksrv prevent crash if rabbitmq is not available when boot #998

Open
felipevicens opened this issue Mar 4, 2018 · 2 comments
Open

Comments

@felipevicens
Copy link
Member

If rabbitmq is not available then the container crashs:

Puma starting in single mode...
* Version 3.11.0 (ruby 2.4.3-p205), codename: Love Song
* Min threads: 0, max threads: 16
* Environment: development
W, [2018-03-04T12:03:39.634952 #1]  WARN -- #<Bunny::Session:0x557e3a0ea200 guest@broker:5672, vhost=/, addresses=[broker:5672]>: Could not establish TCP connection to broker:5672: getaddrinfo: No address associated with hostname
! Unable to load application: Bunny::TCPConnectionFailedForAllHosts: Could not establish TCP connection to any of the configured hosts
bundler: failed to load command: puma (/usr/local/bundle/bin/puma)
Bunny::TCPConnectionFailedForAllHosts: Could not establish TCP connection to any of the configured hosts
  /usr/local/bundle/gems/bunny-2.8.0/lib/bunny/session.rb:329:in `rescue in start'
  /usr/local/bundle/gems/bunny-2.8.0/lib/bunny/session.rb:297:in `start'
  /app/models/mq_server.rb:42:in `initialize'
  /app/gtk_srv.rb:99:in `new'
  /app/gtk_srv.rb:99:in `<class:GtkSrv>'
  /app/gtk_srv.rb:50:in `<top (required)>'
  config.ru:29:in `require'
  config.ru:29:in `block in <main>'
  /usr/local/bundle/gems/rack-2.0.4/lib/rack/builder.rb:55:in `instance_eval'
  /usr/local/bundle/gems/rack-2.0.4/lib/rack/builder.rb:55:in `initialize'
  config.ru:in `new'
  config.ru:in `<main>'
  /usr/local/bundle/gems/rack-2.0.4/lib/rack/builder.rb:49:in `eval'
  /usr/local/bundle/gems/rack-2.0.4/lib/rack/builder.rb:49:in `new_from_string'
  /usr/local/bundle/gems/rack-2.0.4/lib/rack/builder.rb:40:in `parse_file'
  /usr/local/bundle/gems/puma-3.11.0/lib/puma/configuration.rb:318:in `load_rackup'
  /usr/local/bundle/gems/puma-3.11.0/lib/puma/configuration.rb:243:in `app'
  /usr/local/bundle/gems/puma-3.11.0/lib/puma/runner.rb:138:in `load_and_bind'
  /usr/local/bundle/gems/puma-3.11.0/lib/puma/single.rb:87:in `run'
  /usr/local/bundle/gems/puma-3.11.0/lib/puma/launcher.rb:183:in `run'
  /usr/local/bundle/gems/puma-3.11.0/lib/puma/cli.rb:77:in `run'
  /usr/local/bundle/gems/puma-3.11.0/bin/puma:10:in `<top (required)>'
  /usr/local/bundle/bin/puma:21:in `load'
  /usr/local/bundle/bin/puma:21:in `<top (required)>'
@jbonnet
Copy link
Member

jbonnet commented Mar 4, 2018

Hmm...
Shall we add some 'waiting' cycles when deploying, like when we deploy User Management, or do you see another approach?

@felipevicens
Copy link
Member Author

Maybe some error handling and heartbeat as described here:

http://rubybunny.info/articles/error_handling.html

and here:

http://rubybunny.info/articles/connecting.html

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

No branches or pull requests

2 participants