Commit 5a4c8d83 authored by Pavel Vainerman's avatar Pavel Vainerman

(TSDB): sendBytes() error processing

parent 562e8cd4
...@@ -342,7 +342,20 @@ bool BackendOpenTSDB::flushBuffer() ...@@ -342,7 +342,20 @@ bool BackendOpenTSDB::flushBuffer()
try try
{ {
const string s(q.str()); const string s(q.str());
tcp->sendBytes(s.data(), s.size()); ssize_t ret = tcp->sendBytes(s.data(), s.size());
if( ret < 0 )
{
int errnum = errno;
if( errnum == EPIPE || errnum == EBADF )
{
mywarn << "(flushBuffer): send error (" << errnum << "): " << strerror(errnum) << endl;
reconnect();
return false;
}
}
buf.clear(); buf.clear();
askTimer(tmFlushBuffer, 0); askTimer(tmFlushBuffer, 0);
timerIsOn = false; timerIsOn = false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment