[ZBX-13062] Under Windows, Zabbix agent will exit, if timing out at the exact right moment. Created: 2017 Nov 17  Updated: 2024 Apr 10  Resolved: 2018 Mar 06

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Agent (G)
Affects Version/s: 3.4.5rc1, 4.0.0alpha1
Fix Version/s: 3.0.16rc1, 3.4.8rc1, 4.0.0alpha5, 4.0 (plan)

Type: Problem report Priority: Minor
Reporter: Valdis Kauķis (Inactive) Assignee: Michael Veksler
Resolution: Fixed Votes: 0
Labels: agent, timeout, windows
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

MS Windows


Attachments: File test.patch    
Team: Team C
Sprint: Sprint 22, Sprint 23, Sprint 26, Sprint 27, Sprint 28, Sprint 29
Story Points: 1

 Description   

Testing item vfs.dir.count[] under Windows, it was possible to cause Zabbix agent to hang or exit. The last lines in log are:

2236:20171117:153542.878 vfs_dir_count() pro=2 count=30
2236:20171117:153542.893 vfs_dir_count() 10=c:\/Z/zabbix-4.0.0alpha1=1 tmA/C/M=1510312786/1510312715/1510312712=? size=0=OK
2236:20171117:153542.910 vfs_dir_count() pro=2 count=31
2276:20171117:153542.925 WIN zbx_execute_threaded_metric() TIMEOUTED: WaitForSingleObject()
zabbix_agentd.exe [2276]: ERROR file:..\..\..\src\libs\zbxsys\mutexs.c,line:135 Something impossible has just happened.

To reproduce, one of the threaded metrics (vfs.dir.size, vfs.dir.count, vfs.fs.size) must be writing something into zabbix_agentd.log at the moment they time out. That is a very slim possibility, although the first two items are naturally long-running.

To reproduce artificially, void __zbx_zabbix_log(int level, const char *fmt, ...) can be slowed down with e.g. Sleep(1).

As per https://msdn.microsoft.com/en-us/library/windows/desktop/ms687032(v=vs.85).aspx , WAIT_ABANDONED is returned when child process failed to release mutex before termination. Zabbix agent chooses to terminate in response.

Expected:
Zabbix agent should not terminate under unusual conditions that do not themselves prevent its further function.



 Comments   
Comment by Valdis Kauķis (Inactive) [ 2017 Dec 06 ]

Fixed in svn://svn.zabbix.com/branches/dev/ZBX-13062

Comment by Sergejs Paskevics [ 2018 Mar 06 ]

Successfully tested

Generated at Thu Apr 25 10:53:12 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.