Asterisk ODBC reaching max prepared statements

Hi there,

We’re experiencing an issue where we recently upgraded some of our systems to Asterisk 20.8.1. We also moved to the res_odbc.so module.

We have since been seeing MariaDB lock up on these instances due to:

cdr_adaptive_odbc.c: SQL Execute returned an error -1: 42000: [ma-3.2.2][10.5.8-MariaDB-log]Can't create more than max_prepared_stmt_count statements (current value: 16382) (110) 

We have found that reloading the res_odbc.so module does release these prepared statements. Has anyone experienced this before or has any suggestions on what the fix could be here?

Thanks!

Welcome to the forums!

Have you tried seeing what queries these are in your database logs ?

There was also a “logging” option added in res_odbc.conf a few years ago that lets you look at some things from the Asterisk CLI.

Hi Penguin!

Thanks for responding, we have turned the logging on and we just see the queries that we’re using.

We actually changed the driver from mariadb’s to mysql’s ODBC 8.0.29 and the issue has subsided.

We’re assuming the issue lies with mariadb’s driver as the issue is pretty much resolved now.

Thanks!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.