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

Reconnect is fragile #1

Open
epitron opened this issue Mar 10, 2011 · 0 comments
Open

Reconnect is fragile #1

epitron opened this issue Mar 10, 2011 · 0 comments

Comments

@epitron
Copy link

epitron commented Mar 10, 2011

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 }

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

1 participant