zkutil: logging an error when watch leak is suspected. [#METR-10202]

This commit is contained in:
Michael Kolupaev 2014-07-18 16:25:24 +04:00
parent 2f14b3b025
commit e320d6c35c

View File

@ -122,6 +122,10 @@ void * ZooKeeper::watchForEvent(EventPtr event)
{
Poco::ScopedLock<Poco::FastMutex> lock(mutex);
watch_store.insert(res);
if (watch_store.size() % 10000 == 0)
{
LOG_ERROR(log, "There are " << watch_store.size() << " active watches. There must be a leak somewhere.");
}
}
return reinterpret_cast<void *>(res);
}