dropwizard-influxdb-reporter icon indicating copy to clipboard operation
dropwizard-influxdb-reporter copied to clipboard

Exceptions probably shouldn't close the writer

Open billoneil opened this issue 6 years ago • 2 comments

Just hit an issue where the http writer got a timeout exception from our metrics relay which may have been backed up or had a hiccup. This line closed the http writer which made it so metrics could not report for the rest of the JVM processes lifetime.

Is there a particular reason the writers are closed here? That makes it so they can't recover. I think the writers should be able to handle their own failures and it seems like they already can. The HTTP writer will just get a new http connection and try again on the next pass. Once its closed it just fails forever.

billoneil avatar Jul 31 '18 22:07 billoneil

hey @billoneil, sorry for the delayed response — I missed this until now. The TcpWriter should recreate the connection after closing, and the HTTP writer should do the same (but currently doesn't).

I think the writers should be able to handle their own failures and it seems like they already can. The HTTP writer will just get a new http connection and try again on the next pass. Once its closed it just fails forever.

I wasn't aware of this behavior in the writers, but if so, then you're right — we can avoid manually closing the connection here.

kyeah avatar Sep 05 '18 19:09 kyeah

@kyeah I'll try to make some pull requests when I get around to it for you. Have been a bit busy

billoneil avatar Sep 05 '18 21:09 billoneil