postrank-labs/goliath

Getting issues in app due to lock/ compatibility between ruby 2.0.0 and goliath 1.0.3

LoveleenS opened this issue · 2 comments

Hi, One of the apps at my org is deployed on heroku. While monitoring the logs on heroku we observed
an exception and the app stops/goes to sleep.
It is accompanied by exception like this one:

» 2 Feb 2016 18:03:22.821 2016-02-02 07:03:22.485131+00:00 heroku web.1 - - Idling
» 2 Feb 2016 18:03:22.902 2016-02-02 07:03:22.485131+00:00 heroku web.1 - - State changed from up to down
» 2 Feb 2016 18:03:26.587 2016-02-02 07:03:26.441335+00:00 heroku web.1 - - Stopping all processes with SIGTERM
» 2 Feb 2016 18:03:28.209 2016-02-02 07:03:27.893080+00:00 app web.1 - - /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/monitor.rb:185:in lock': can't be called from trap context (ThreadError) from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/monitor.rb:185:inmon_enter' from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/monitor.rb:209:in mon_synchronize' from /app/vendor/bundle/ruby/2.0.0/gems/log4r-1.1.10/lib/log4r/outputter/outputter.rb:130:insynch' from /app/vendor/bundle/ruby/2.0.0/gems/log4r-1.1.10/lib/log4r/outputter/outputter.rb:110:in canonical_log' from (eval):3:ininfo' from (eval):8:in block in info' from (eval):8:ineach' from (eval):8:in info' from /app/vendor/bundle/ruby/2.0.0/gems/goliath-1.0.3/lib/goliath/server.rb:110:instop' from /app/vendor/bundle/ruby/2.0.0/gems/goliath-1.0.3/lib/goliath/server.rb:75:in block (2 levels) in start' from /app/vendor/bundle/ruby/2.0.0/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:incall' from /app/vendor/bundle/ruby/2.0.0/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:in run_machine' from /app/vendor/bundle/ruby/2.0.0/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:inrun' from /app/vendor/bundle/ruby/2.0.0/gems/em-synchrony-1.0.3/lib/em-synchrony.rb:38:in synchrony' from /app/vendor/bundle/ruby/2.0.0/gems/goliath-1.0.3/lib/goliath/server.rb:73:instart' from /app/vendor/bundle/ruby/2.0.0/gems/goliath-1.0.3/lib/goliath/runner.rb:304:in run_server' from /app/vendor/bundle/ruby/2.0.0/gems/goliath-1.0.3/lib/goliath/runner.rb:224:inrun' from /app/vendor/bundle/ruby/2.0.0/gems/goliath-1.0.3/lib/goliath/application.rb:111:in run!' from /app/vendor/bundle/ruby/2.0.0/gems/goliath-1.0.3/lib/goliath/application.rb:133:inblock in module:Goliath' Exception
» 2 Feb 2016 18:03:29.169 2016-02-02 07:03:28.920747+00:00 heroku web.1 - - Process exited with status 143

We got to know from support that this line in goliath is causing the issue -> https://github.com/postrank-labs/goliath/blob/v1.0.3/lib/goliath/server.rb#L110

Can you guys help to resolve this one? Not with ruby background so any detail will be greatly appreciated.

Thanks

The exception happens when the process receives a SIGTERM (i.e. the process is being killed).. so, just to clarify, this is not causing a crash while the process is running; it's preventing a "clean shutdown".

That said, it looks like log4r is the culprit here.. Hmm.

@LoveleenS Were you able to make any progress here? Anything else we can help with?