riemann/riemann

`forward` does not reconnect to when connection interrupted

vipinvkmenon opened this issue · 3 comments

This is more of a question regarding one of the functions forward.

I was trying to set up a froward of streams between 2 riemanns. Riemann 1 forwards events to Riemann 2 using forward.
However if for some reason if Riemann 2 restarts or if Riemann 2 starts up after Riemann 1 the events are not. forwarded.

However, if I were to write in Riemann 1code as say:

(def riemann-client (r/tcp-client {:host "riemann2" :port 5556}))
(batch 5000 1
            (async-queue! :a-queue
                         {:queue-size 1e4}
                           (partial r/send-events riemann-client)))

In this case Riemann 1 forwards events to Riemann 2 irrespective of whether Riemann 2 starts up after Riemann 1 or Riemann 2 restarts multiple times in between. basically the tcp-client is able to reconnect no matter what.

The riemann-clojure-client doc states that the clients will try to auto-reconnect.

But somehow this doesn't seem to be happening with forward. Does it have something to do with the dereferencing happening in forward?

How can forward be made to reconnect (retry) with a client that its lost connection with ?

I also got this problem on version 0.3.6.
Is anyone has an idea on this?
Thanks.

sanel commented

@vipinvkmenon @frankietseng what your forwarding code looks like or can you extract working code that fails?

I've tested small sample with 0.3.1 and 0.3.6 and it looks OK to me. It will take couple of seconds Riemann 1 to connect to Riemann 2, after Riemann 2 was restarted; in the mean time, Riemann 1 should throw java.io.IOException: no channels available exceptions, when forward is made.

Please re-open if you still have issues.