logstash-plugins / logstash-input-heroku

Apache License 2.0
8 stars 12 forks source link

Reconnect client automatically on disconnect #1

Open wiibaa opened 9 years ago

wiibaa commented 9 years ago

Initial report: https://github.com/elasticsearch/logstash-contrib/issues/39

I recently installed logstash to get logs from a couple of heroku apps. The problem is that the heroku input closes randomly. This causes the logstash instance to stop because I have only one input configured. This problem is visible not just with the logstash contrib plugin but can also be observed using the heroku toolbelt so this is not the input's fault. I added a simple solution to my local contrib installation by wrapping the log tailing in the heroku input in a while loop. I would like to ask if this is a valid solution and if yes then I will submit a PR for this fix.

Possible root cause: https://github.com/heroku/heroku/issues/619#issuecomment-11317992

adamenger commented 9 years ago

This is still an issue :( I have multiple inputs configured in my instance of Logstash and once the Heroku client finishes, it disconnects and crashes Logstash.

vinnyoodles commented 8 years ago

I'm seeing this same error, @gauravarora do you still have the fixed code?

gauravarora commented 8 years ago

Unfortunately, no. :(

vinnyoodles commented 8 years ago

Was your solution something along the lines of

while true do 
  client.read_logs
  ...
end
gauravarora commented 8 years ago

@vinnyoodles yes. Except I had a sleep in there somewhere because sometimes the heroku logplex behaves weirdly and doesn't return any data. My app wasn't very heavy or access very frequently so I think i had it sleep for 60 seconds.

I'm really sorry about loosing that code. I should have checked it into a branch somewhere.