mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-19 19:54:34 +02:00
Merge pull request #6770 from Icinga/bugfix/graphitewriter-deadlock
Fix deadlock in GraphiteWriter
This commit is contained in:
commit
374dd91deb
@ -299,7 +299,7 @@ void GraphiteWriter::SendMetric(const String& prefix, const String& name, double
|
|||||||
msgbuf << "\n";
|
msgbuf << "\n";
|
||||||
String metric = msgbuf.str();
|
String metric = msgbuf.str();
|
||||||
|
|
||||||
ObjectLock olock(this);
|
boost::mutex::scoped_lock lock(m_StreamMutex);
|
||||||
|
|
||||||
if (!GetConnected())
|
if (!GetConnected())
|
||||||
return;
|
return;
|
||||||
|
@ -27,6 +27,7 @@
|
|||||||
#include "base/timer.hpp"
|
#include "base/timer.hpp"
|
||||||
#include "base/workqueue.hpp"
|
#include "base/workqueue.hpp"
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
|
#include <boost/thread/mutex.hpp>
|
||||||
|
|
||||||
namespace icinga
|
namespace icinga
|
||||||
{
|
{
|
||||||
@ -54,6 +55,7 @@ protected:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
Stream::Ptr m_Stream;
|
Stream::Ptr m_Stream;
|
||||||
|
boost::mutex m_StreamMutex;
|
||||||
WorkQueue m_WorkQueue{10000000, 1};
|
WorkQueue m_WorkQueue{10000000, 1};
|
||||||
|
|
||||||
Timer::Ptr m_ReconnectTimer;
|
Timer::Ptr m_ReconnectTimer;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user