[ZBX-16256] Possible infinite fetch loop with oracle Created: 2019 Jun 13  Updated: 2024 Apr 10  Resolved: 2019 Jul 22

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Proxy (P), Server (S)
Affects Version/s: 3.0.28
Fix Version/s: 4.0.11rc1, 4.2.5rc1, 4.4.0alpha1, 4.4 (plan)

Type: Problem report Priority: Major
Reporter: Andris Zeila Assignee: Viktors Tjarve
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Oracle


Attachments: File ZBX-16256-v3_4_final.patch     File ZBX-16256_v3_4.patch     File ZBX-16256_v3_4_less_logs.patch    
Issue Links:
Duplicate
Team: Team A
Team: Team A
Sprint: Sprint 53 (Jun 2019), Sprint 54 (Jul 2019)
Story Points: 1

 Description   

When executing DBfetch(), Zabbix checks for the following OCIStmtFetch2() errors:

			case 1012:	/* ORA-01012: not logged on */
			case 2396:	/* ORA-02396: exceeded maximum idle time */
			case 3113:	/* ORA-03113: end-of-file on communication channel */
			case 3114:	/* ORA-03114: not connected to ORACLE */

Apparently there are more errors, as we had situation with DBfetch() entering infinite loop with the same row returned. By the documentation OCIStmtFetch2() can return OCI_NO_DATA or OCI_SUCCESS_WITH_INFO. However returning OCI_SUCCESS_WITH_INFO while setting ORA-03114 error would be quite strange, so it probably can return also OCI_ERROR.

We should check the returned code with database errors (that should be easy to reproduce). If it really returns OCI_ERROR, then I believe we should simply check for OCI_ERROR and return NULL rowset, instead of blacklisting error codes.

If OCIStmtFetch2() really returns only OCI_NO_DATA or OCI_SUCCESS_WITH_INFO, then it might be better to whitelist the errors Oracle has documented (ORA-24344, ORA-24345, ORA-24347) and return NULL rowset for the rest.

At the very least if we are keeping current behavior, we should log the eror so it could be blacklisted if necessary.



 Comments   
Comment by Viktors Tjarve [ 2019 Jul 09 ]

Releases in:

Generated at Fri Apr 19 05:27:49 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.