adhearsion/adhearsion — Issue #120: Adhearsion errors on XMPP server shutdown
Author: bklang
Created: 2012-02-22 18:07:35+00:00
State: open

Two different error conditions. The first is where the server shutdown and Adhearsion (Punchblock) did not gracefully restart. The second was where the connection was refused when trying to reconnect. I think in both cases we just need to rescue this exception with the other Blather errors.

```
[2012-02-22 13:03:07] ERROR Adhearsion::Initializer: Stream Error (system-shutdown):
/Users/bklang/.rvm/gems/ruby-1.9.3-p125/gems/blather-0.5.12/lib/blather/client/client.rb:224:in `block in setup_initial_handlers'
/Users/bklang/.rvm/gems/ruby-1.9.3-p125/gems/blather-0.5.12/lib/blather/client/client.rb:287:in `call'
/Users/bklang/.rvm/gems/ruby-1.9.3-p125/gems/blather-0.5.12/lib/blather/client/client.rb:287:in `call_handler'
/Users/bklang/.rvm/gems/ruby-1.9.3-p125/gems/blather-0.5.12/lib/blather/client/client.rb:278:in `block (2 levels) in call_handler_for'
/Users/bklang/.rvm/gems/ruby-1.9.3-p125/gems/blather-0.5.12/lib/blather/client/client.rb:278:in `catch'
/Users/bklang/.rvm/gems/ruby-1.9.3-p125/gems/blather-0.5.12/lib/blather/client/client.rb:278:in `block in call_handler_for'
/Users/bklang/.rvm/gems/ruby-1.9.3-p125/gems/blather-0.5.12/lib/blather/client/client.rb:277:in `each'
/Users/bklang/.rvm/gems/ruby-1.9.3-p125/gems/blather-0.5.12/lib/blather/client/client.rb:277:in `find'
/Users/bklang/.rvm/gems/ruby-1.9.3-p125/gems/blather-0.5.12/lib/blather/client/client.rb:277:in `call_handler_for'
/Users/bklang/.rvm/gems/ruby-1.9.3-p125/gems/blather-0.5.12/lib/blather/client/client.rb:270:in `block in handle_stanza'
/Users/bklang/.rvm/gems/ruby-1.9.3-p125/gems/blather-0.5.12/lib/blather/client/client.rb:269:in `each'
/Users/bklang/.rvm/gems/ruby-1.9.3-p125/gems/blather-0.5.12/lib/blather/client/client.rb:269:in `handle_stanza'
/Users/bklang/.rvm/gems/ruby-1.9.3-p125/gems/blather-0.5.12/lib/blather/client/client.rb:186:in `block in receive_data'
/Users/bklang/.rvm/gems/ruby-1.9.3-p125/gems/blather-0.5.12/lib/blather/client/client.rb:184:in `catch'
/Users/bklang/.rvm/gems/ruby-1.9.3-p125/gems/blather-0.5.12/lib/blather/client/client.rb:184:in `receive_data'
/Users/bklang/.rvm/gems/ruby-1.9.3-p125/gems/blather-0.5.12/lib/blather/stream.rb:203:in `unbind'
/Users/bklang/.rvm/gems/ruby-1.9.3-p125/gems/eventmachine-0.12.10/lib/eventmachine.rb:1417:in `event_callback'
/Users/bklang/.rvm/gems/ruby-1.9.3-p125/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `run_machine'
/Users/bklang/.rvm/gems/ruby-1.9.3-p125/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `run'
/Users/bklang/.rvm/gems/ruby-1.9.3-p125/bundler/gems/punchblock-cbc42b1fe3df/lib/punchblock/connection/xmpp.rb:78:in `connect'
/Users/bklang/.rvm/gems/ruby-1.9.3-p125/bundler/gems/punchblock-cbc42b1fe3df/lib/punchblock/connection/xmpp.rb:73:in `run'
/Users/bklang/.rvm/gems/ruby-1.9.3-p125/bundler/gems/punchblock-cbc42b1fe3df/lib/punchblock/client.rb:11:in `run'
/Users/bklang/.rvm/gems/ruby-1.9.3-p125/bundler/gems/adhearsion-0961a4cfe400/lib/adhearsion/punchblock_plugin/initializer.rb:99:in `connect_to_server'
/Users/bklang/.rvm/gems/ruby-1.9.3-p125/bundler/gems/adhearsion-0961a4cfe400/lib/adhearsion/punchblock_plugin/initializer.rb:89:in `block (2 levels) in connect'
/Users/bklang/.rvm/gems/ruby-1.9.3-p125/bundler/gems/adhearsion-0961a4cfe400/lib/adhearsion/foundation/exception_handler.rb:4:in `catching_standard_errors'
/Users/bklang/.rvm/gems/ruby-1.9.3-p125/bundler/gems/adhearsion-0961a4cfe400/lib/adhearsion/punchblock_plugin/initializer.rb:89:in `block in connect'
[2012-02-22 13:04:27] ERROR Adhearsion::Initializer: Operation timed out - connect(2)
/Users/bklang/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/net/http.rb:762:in `initialize'
/Users/bklang/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/net/http.rb:762:in `open'
/Users/bklang/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/net/http.rb:762:in `block in connect'
/Users/bklang/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/timeout.rb:54:in `timeout'
/Users/bklang/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/timeout.rb:99:in `timeout'
/Users/bklang/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/net/http.rb:762:in `connect'
/Users/bklang/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/net/http.rb:755:in `do_start'
/Users/bklang/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/net/http.rb:744:in `start'
/Users/bklang/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/net/http.rb:557:in `start'
/Users/bklang/.rvm/gems/ruby-1.9.3-p125/gems/toadhopper-2.0/lib/toadhopper.rb:111:in `post_document'
/Users/bklang/.rvm/gems/ruby-1.9.3-p125/gems/toadhopper-2.0/lib/toadhopper.rb:55:in `post!'
/Users/bklang/.rvm/gems/ruby-1.9.3-p125/bundler/gems/adhearsion-reporter-8d3d380c2cd2/lib/adhearsion/reporter.rb:15:in `block (2 levels) in '
/Users/bklang/.rvm/gems/ruby-1.9.3-p125/gems/has-guarded-handlers-1.1.0/lib/has_guarded_handlers.rb:60:in `call'
/Users/bklang/.rvm/gems/ruby-1.9.3-p125/gems/has-guarded-handlers-1.1.0/lib/has_guarded_handlers.rb:60:in `call_handler'
/Users/bklang/.rvm/gems/ruby-1.9.3-p125/bundler/gems/adhearsion-0961a4cfe400/lib/adhearsion/events.rb:74:in `call_handler'
/Users/bklang/.rvm/gems/ruby-1.9.3-p125/gems/has-guarded-handlers-1.1.0/lib/has_guarded_handlers.rb:43:in `block (3 levels) in trigger_handler'
/Users/bklang/.rvm/gems/ruby-1.9.3-p125/gems/has-guarded-handlers-1.1.0/lib/has_guarded_handlers.rb:43:in `catch'
/Users/bklang/.rvm/gems/ruby-1.9.3-p125/gems/has-guarded-handlers-1.1.0/lib/has_guarded_handlers.rb:43:in `block (2 levels) in trigger_handler'
/Users/bklang/.rvm/gems/ruby-1.9.3-p125/gems/has-guarded-handlers-1.1.0/lib/has_guarded_handlers.rb:42:in `each'
/Users/bklang/.rvm/gems/ruby-1.9.3-p125/gems/has-guarded-handlers-1.1.0/lib/has_guarded_handlers.rb:42:in `find'
/Users/bklang/.rvm/gems/ruby-1.9.3-p125/gems/has-guarded-handlers-1.1.0/lib/has_guarded_handlers.rb:42:in `block in trigger_handler'
/Users/bklang/.rvm/gems/ruby-1.9.3-p125/gems/has-guarded-handlers-1.1.0/lib/has_guarded_handlers.rb:41:in `catch'
/Users/bklang/.rvm/gems/ruby-1.9.3-p125/gems/has-guarded-handlers-1.1.0/lib/has_guarded_handlers.rb:41:in `trigger_handler'
/Users/bklang/.rvm/gems/ruby-1.9.3-p125/bundler/gems/adhearsion-0961a4cfe400/lib/adhearsion/events.rb:53:in `handle_message'
/Users/bklang/.rvm/gems/ruby-1.9.3-p125/bundler/gems/adhearsion-0961a4cfe400/lib/adhearsion/events.rb:45:in `block in reinitialize_queue!'
/Users/bklang/.rvm/gems/ruby-1.9.3-p125/gems/girl_friday-0.9.7/lib/girl_friday/work_queue.rb:139:in `call'
/Users/bklang/.rvm/gems/ruby-1.9.3-p125/gems/girl_friday-0.9.7/lib/girl_friday/work_queue.rb:139:in `block (2 levels) in start'
/Users/bklang/.rvm/gems/ruby-1.9.3-p125/gems/girl_friday-0.9.7/lib/girl_friday/actor.rb:86:in `call'
/Users/bklang/.rvm/gems/ruby-1.9.3-p125/gems/girl_friday-0.9.7/lib/girl_friday/actor.rb:86:in `block in spawn_link'
/Users/bklang/.rvm/gems/ruby-1.9.3-p125/gems/girl_friday-0.9.7/lib/girl_friday/actor.rb:69:in `call'
/Users/bklang/.rvm/gems/ruby-1.9.3-p125/gems/girl_friday-0.9.7/lib/girl_friday/actor.rb:69:in `block (2 levels) in spawn'
/Users/bklang/.rvm/gems/ruby-1.9.3-p125/gems/girl_friday-0.9.7/lib/girl_friday/actor.rb:212:in `block in initialize'
/Users/bklang/.rvm/gems/ruby-1.9.3-p125/gems/girl_friday-0.9.7/lib/girl_friday/actor.rb:377:in `watchdog'
/Users/bklang/.rvm/gems/ruby-1.9.3-p125/gems/girl_friday-0.9.7/lib/girl_friday/actor.rb:212:in `initialize'
/Users/bklang/.rvm/gems/ruby-1.9.3-p125/gems/girl_friday-0.9.7/lib/girl_friday/actor.rb:66:in `new'
/Users/bklang/.rvm/gems/ruby-1.9.3-p125/gems/girl_friday-0.9.7/lib/girl_friday/actor.rb:66:in `block in spawn'
```