7 Commits

Author SHA1 Message Date
Julian Brost
340b803a8f
Merge pull request #9322 from Icinga/perfdata-resume-signal
Perfdata writers: disconnect handlers from signals in Pause()
2022-04-07 15:52:00 +02:00
Alexander A. Klimov
56933b8877 Perfdata writers: disconnect handlers from signals in Pause()
as they would be re-connected in Resume() (HA).

Before they were still connected during pause and connected X+1 times
after X split-brains (the same data was written X+1 times).
2022-04-06 13:09:26 +02:00
Alexander Aleksandrovič Klimov
4fc6523b12 InfluxdbCommonWriter#Flush(): fix log message
s/InfluxdbWriter/Influxdb2Writer/

fixes #9035
2022-04-01 11:22:16 +02:00
Julian Brost
9b2f95d6d2 InfluxdbCommonWriter: use atomic_size_t to data buffer size from stats function
m_DataBuffer may be modified concurrently while StatsFunc() is called, thus
it's unsafe to call size() on it. As write access to m_DataBuffer is already
synchronized by only modifying it from the single work queue thread, instead of
adding a mutex, this commit adds a new std::atomic_size_t which is additionally
updated when modifying m_DataBuffer and can safely be accessed in StatsFunc().
2022-02-21 15:11:56 +01:00
Julian Brost
6b69235e15 InfluxdbCommonWriter: only flush from work queue
There is no explicit synchronization of access to m_DataBuffer which is fine if
it is only accessed from the single-threaded work queue. However, Stop() also
called Flush() in another thread, leading to concurrent write access to
m_DataBuffer which can result in a crash due to use after free/double free.

Changes in this commit:
* Flush() is renamed to FlushWQ() to show that it should only be called from
  the work queue. Additionally, it now asserts that it is running on the work
  queue.
* Visibility of some data members is changed from protected to private. No
  other classes have to access these at the moment. By this change, accidental
  concurrent access from derived classes in the future is prevented.
* Stop() now flushes by posting FlushWQ() to the work queue and joining it.
2022-02-21 15:11:56 +01:00
Julian Brost
50a7980709 InfluxdbCommonWriter: actually verify TLS server certificates
And add a new option ssl_insecure_noverify to explicitly disable it if desired.
2021-08-19 11:06:19 +02:00
Alexander A. Klimov
d26aa9fb34 InfluxdbCommonWriter: abstract InfluxdbWriter
refs #8711
2021-07-20 16:21:36 +02:00