bunyan-elasticsearch icon indicating copy to clipboard operation
bunyan-elasticsearch copied to clipboard

Pinging elasticsearch before index

Open ahmetcetin opened this issue 8 years ago • 2 comments

Pinging elasticsearch before index not to crash

ahmetcetin avatar Feb 22 '17 15:02 ahmetcetin

Thx for the PR!

The issue that I see is that this PR will swallow potential write errors :-o and simply console log them. IMHO errors should be thrown/returned so that the application can handle them properly.

Ideally, we would like to retry the write when the cluster was temporarily down.

Also, it seems unnecessary to ping before write, since if the cluster is down, write will return an error exactly like ping does. I cannot see the benefit of the added ping, but maybe I am missing something here.

Can you maybe explain your scenario / use case a bit more?

moooji avatar Feb 28 '17 19:02 moooji

this could be potentially useful for say container-based environments where i may want to do a health check prior to marking something g2g.

for instance if im doing container rotations i want to make sure that something that was configured isnt broken after ive taken prior, healthy containers down.

gfogle avatar Jun 17 '17 21:06 gfogle