brettwooldridge / influx4j

High-performance, zero-garbage, Java client/driver for InfluxDB.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

FR: write points and interrupt Lock on connection close

mburger81 opened this issue · comments

Hello,

in some scenarios like the ours, we undeploy the bundle which is using your influx4j lib. In this scenario we would like to have the guarantee that on closing connection the points are written. Or at least it would be tried once to write them, if there is for example no connection abort it.

Not sure how to do this, because we can not unpark the Lock until first park is finished. We have only a few recods per minute so we don't wan't one write per second but for example only once every 5 minutes. So on undeploing the bundle we need to wait until this 5 minutes are over. Which is a very bad situation.
Also in our embeded scenario we have often bad internet so we have many times no connection. If we are without connection and the influxdb retry every second to store the data this is a bad overhead. For that reason we installe our system with 1 to 5 minutes autoflush period.

But on "shutdown" we would like immediately break the Lock Try once to store the data and stop the manager.

p.s. perhaps do you have seen our other PR for some other improvements (we have another few but not merged right now)