Branch: refs/heads/master
Home:
https://github.com/tribe29/checkmk
Commit: a33bb33f01573123fdaccfe95bf6dcee99a550e5
https://github.com/tribe29/checkmk/commit/a33bb33f01573123fdaccfe95bf6dcee9…
Author: Sergey Kipnis <sergey.kipnis(a)tribe29.com>
Date: 2020-11-04 (Wed, 04 Nov 2020)
Changed paths:
M livestatus/src/Logger.cc
M livestatus/src/Logger.h
Log Message:
-----------
[CMK-6115] - prevent race condition between setHandler and log with mutex
This solution is absolutely minimalistic, just to hot fix error and provide easy
backporting.
Important notes:
Hotfix is based on the current algorithm of setHandler/getHandler usage.
Performance is comparable. Few nanoseconds per a log entry means almost nothing.
Possible improvements for the next commit(or instead):
- remove virtual getHandler interface as exposing implementation details
- replace virtual Logger::setHandler with non virtual Logger::setHandler
- introduce non-virtual Logger::publish interface
- introduce non-virtual Logger::setFormatter
Change-Id: I2902c06adbbe953611ba9ca0957dca42a2f48bc6