marvin icon indicating copy to clipboard operation
marvin copied to clipboard

Reconnect is fragile

Open epitron opened this issue 14 years ago • 0 comments

It looks like when a DNS query fails, the bot just gives up reconnecting forever:

 [WARN] Adding timer to reconnect to irc.freenode.net:6667 in 15 seconds
/usr/lib/ruby/gems/1.8/gems/eventmachine-0.12.10/lib/eventmachine.rb:714:in `connect_server': unable to resolve server address (EventMachine::ConnectionError)
        from /usr/lib/ruby/gems/1.8/gems/eventmachine-0.12.10/lib/eventmachine.rb:714:in `bind_connect'
        from /usr/lib/ruby/gems/1.8/gems/eventmachine-0.12.10/lib/eventmachine.rb:692:in `connect'
        from /usr/lib/ruby/gems/1.8/gems/marvin-0.8.2/bin/../lib/marvin/irc/client.rb:129:in `connect'
        from /usr/lib/ruby/gems/1.8/gems/marvin-0.8.2/bin/../lib/marvin/irc/client.rb:146:in `add_reconnect'

There are probably a lot of different ways a connect can throw exceptions, so a simple workaround would be: 5.times { begin; <connect>; rescue; sleep 15; end }

epitron avatar Mar 10 '11 09:03 epitron