[ZBX-9002] Zabbix does not lock log file during logging Created: 2014 Nov 06 Updated: 2017 May 30 Resolved: 2014 Dec 02 |
|
Status: | Closed |
Project: | ZABBIX BUGS AND ISSUES |
Component/s: | Agent (G), Proxy (P), Server (S) |
Affects Version/s: | 2.0.13, 2.2.7, 2.4.2 |
Fix Version/s: | 2.5.0 |
Type: | Incident report | Priority: | Major |
Reporter: | Andris Zeila | Assignee: | Unassigned |
Resolution: | Fixed | Votes: | 0 |
Labels: | logging | ||
Remaining Estimate: | Not Specified | ||
Time Spent: | Not Specified | ||
Original Estimate: | Not Specified | ||
Environment: |
Unix-like systems |
Issue Links: |
|
Description |
src/libs/zbxsys/mutexs.c if (ZBX_MUTEX_NULL == *mutex) return; But on *nix like systems ZBX_MUTEX_NULL matches ZBX_MUTEX_LOG value (0). So the log mutex is never locked. We should change ZBX_MUTEX_NULL to (-1) for *nix systems. |
Comments |
Comment by Andris Zeila [ 2014 Nov 06 ] |
(1) While at that we also could replace ZBX_MUTEX_ERROR, ZBX_MUTEX_OK with FAIL, SUCCEED. igorsh RESOLVED in r50607. asaveljevs Your changes define ZBX_MUTEX_OK to SUCCEED and ZBX_MUTEX_ERROR to FAIL, whereas the real intention behind Andris' proposal was to remove ZBX_MUTEX_OK and ZBX_MUTEX_ERROR altogether, replacing them with SUCCEED and FAIL, respectively. REOPENED. igorsh RESOLVED in r50891. asaveljevs CLOSED |
Comment by Igors Homjakovs (Inactive) [ 2014 Nov 14 ] |
Fixed in svn://svn.zabbix.com/branches/dev/ZBX-9002 |
Comment by Igors Homjakovs (Inactive) [ 2014 Dec 02 ] |
The performance overhead of this fix has been evaluated. Ten poller processes where used. Each process started writing 100000 log messages to the log file after startup. Without locking it took ~3.1 sec for each process to complete this task. With locking the result was ~3.8 sec. This shows that log file locking added approximately 20% overhead in this scenario. |
Comment by Igors Homjakovs (Inactive) [ 2014 Dec 02 ] |
Available in pre-2.5.0 (trunk) r50971. |
Comment by Alexander Vladishev [ 2014 Dec 02 ] |
(2) Documentation There are no any user-side functional changes. CLOSED |
Comment by richlv [ 2015 Feb 05 ] |
we might have to backport this fix as per |