katja-beam / katja

A simple Riemann client written in Erlang.
https://hex.pm/packages/katja
ISC License
27 stars 19 forks source link

Handle connection failures on start #5

Closed puzza007 closed 9 years ago

puzza007 commented 9 years ago

Will now return {ok, State} even if it can't connect on start using TCP.

coveralls commented 9 years ago

Coverage Status

Coverage increased (+0.27%) to 96.01% when pulling 70e90848e3522e382232104f2847eaa8afb4b8f3 on puzza007:handle-connection-failures-on-start into 2a8003416a86f2d61412180b40664e0517e7bdb5 on nifoc:master.

nifoc commented 9 years ago

Sorry for the very late reply! Your two latest PRs totally slipped by me.

If you're still interested, I can probably take a look at them over the weekend.

puzza007 commented 9 years ago

Hey @nifoc. I can restore the branches if you want. We've ended up modifying our fork quite a bit as we have very... unconventional desires :smile:

coveralls commented 9 years ago

Coverage Status

Coverage increased (+0.27%) to 96.01% when pulling 70e90848e3522e382232104f2847eaa8afb4b8f3 on puzza007:handle-connection-failures-on-start into 2a8003416a86f2d61412180b40664e0517e7bdb5 on nifoc:master.

coveralls commented 9 years ago

Coverage Status

Coverage increased (+0.27%) to 96.01% when pulling 70e90848e3522e382232104f2847eaa8afb4b8f3 on puzza007:handle-connection-failures-on-start into 2a8003416a86f2d61412180b40664e0517e7bdb5 on nifoc:master.

nifoc commented 9 years ago

I added most of the functionality in this PR to the development branch.

I did not merge it because it looks like your code basically indefinitely tries to reconnect and I'm not sure if that's a good idea. I'm certainly open to a discussion about it :smile:

The major difference between your PR and the way I decided to implement it is that I only try to (re-) connect to Riemann two times max. and return {error, too_many_tries} after that. Maybe the number of retries should be higher/configurable.

In any case: Thank you very much for bringing this issue to my attention!