[ZBX-9935] Infinite loop if item delay < 0 Created: 2015 Oct 02  Updated: 2017 May 30  Resolved: 2015 Nov 24

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: API (A)
Affects Version/s: 2.0.16rc1, 2.2.11rc1, 2.4.7rc1, 3.0.0alpha3
Fix Version/s: 2.0.16rc1, 2.2.11rc1, 2.4.7rc1, 3.0.0alpha4

Type: Incident report Priority: Critical
Reporter: Oleg Egorov (Inactive) Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: delay, item, timeout
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

How to reproduce:

item.update
{
    "itemid": "23672",
    "delay": "-1"
}

Should be fixed after ZBXNEXT-2128



 Comments   
Comment by dimir [ 2015 Oct 05 ]

As oleg.egorov mentioned, in 2.0, 2.2, 2.4 and trunk it's possible to set item delay to a negative value.

Server behavior: in case delay is -1 server sets nextcheck to 6.5 hours:

mysql> select delay from items where key_='system.uptime' and hostid=10084;
+-------+
| delay |
+-------+
|    -1 |
+-------+
1 row in set (0.00 sec)
 29997:20151002:155237.248 DIMIR In calculate_item_nextcheck()
 29997:20151002:155237.248 DIMIR End of calculate_item_nextcheck():1443814019
[...]
 30002:20151002:222659.612 DIMIR In calculate_item_nextcheck()
 30002:20151002:222659.612 DIMIR End of calculate_item_nextcheck():1443837681
[...]
 30002:20151003:050121.069 DIMIR In calculate_item_nextcheck()
 30002:20151003:050121.069 DIMIR End of calculate_item_nextcheck():1443861343
[...]
 30002:20151003:113543.333 DIMIR In calculate_item_nextcheck()
 30002:20151003:113543.333 DIMIR End of calculate_item_nextcheck():1443885005
[...]
 30002:20151003:181005.599 DIMIR In calculate_item_nextcheck()
 30002:20151003:181005.599 DIMIR End of calculate_item_nextcheck():1443908667
[...]
 30002:20151004:004427.086 DIMIR In calculate_item_nextcheck()
 30002:20151004:004427.086 DIMIR End of calculate_item_nextcheck():1443932329
[...]
 30002:20151004:071849.211 DIMIR In calculate_item_nextcheck()
 30002:20151004:071849.211 DIMIR End of calculate_item_nextcheck():1443955991
[...]
 30002:20151004:135311.224 DIMIR In calculate_item_nextcheck()
 30002:20151004:135311.224 DIMIR End of calculate_item_nextcheck():1443979653
[...]
 30002:20151004:202733.186 DIMIR In calculate_item_nextcheck()
 30002:20151004:202733.186 DIMIR End of calculate_item_nextcheck():1444003315
[...]
 30002:20151005:030155.136 DIMIR In calculate_item_nextcheck()
 30002:20151005:030155.136 DIMIR End of calculate_item_nextcheck():1444026977
[...]
 30002:20151005:093617.911 DIMIR In calculate_item_nextcheck()
 30002:20151005:093617.911 DIMIR End of calculate_item_nextcheck():1444050639
Comment by vitalijs.cemeris (Inactive) [ 2015 Oct 08 ]

(1) No translation strings changed.

iivs CLOSED

Comment by vitalijs.cemeris (Inactive) [ 2015 Oct 08 ]

RESOLVED in development branch svn://svn.zabbix.com/branches/dev/ZBX-9935

Comment by Ivo Kurzemnieks [ 2015 Oct 09 ]

(2)

  • There was no need for new function checkValueBetween() (it has only one usage and violates about 5 coding style rules);
  • checkDelayFlex() should've not been refactored for old branch (and it also has now has more coding style violations).

What should've been done:
the code $res['delay'] == 0 was supposed to be changed to $res['delay'] <= 0

vitalijs.cemeris RESOLVED in r56061

iivs Please, take a look at my changes in r56301

vitalijs.cemeris CLOSED

Comment by Ivo Kurzemnieks [ 2015 Oct 21 ]

TESTED,

but please close (2) before merging.

Comment by vitalijs.cemeris (Inactive) [ 2015 Oct 27 ]

FIXED IN

  • pre-2.0.16rc1 r56334
  • pre-2.2.11rc1 r56344
  • pre-2.4.7rc1 r56345
  • pre-3.0.0alpha4 (trunk) r56382
Generated at Thu Apr 18 07:27:24 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.