i saw these kind of error messages in syslog:
May 20 00:32:56 proxy /usr/bin/sip-proxy[27601]: ERROR: db_mysql [km_dbase.c:123]: db_mysql_submit_query(): driver error on query: Lost connection to MySQL server during query May 20 00:32:56 proxy /usr/bin/sip-proxy[27601]: ERROR: db_mysql [km_dbase.c:145]: db_mysql_async_exec_task(): failed to execute query on async worker
it would be nice of the error message would tell which query was in question.
-- juha
On 20/05/15 07:38, Juha Heinanen wrote:
i saw these kind of error messages in syslog:
May 20 00:32:56 proxy /usr/bin/sip-proxy[27601]: ERROR: db_mysql [km_dbase.c:123]: db_mysql_submit_query(): driver error on query: Lost connection to MySQL server during query May 20 00:32:56 proxy /usr/bin/sip-proxy[27601]: ERROR: db_mysql [km_dbase.c:145]: db_mysql_async_exec_task(): failed to execute query on async worker
it would be nice of the error message would tell which query was in question.
perhaps the log in db_mysql_async_exec_task() can be easily extended to print more details.
Cheers, Daniel
Daniel-Constantin Mierla writes:
perhaps the log in db_mysql_async_exec_task() can be easily extended to print more details.
looks like it. i made the change below. is it ok to commit the diff?
-- juha
*** /usr/src/orig/kamailio/modules/db_mysql/km_dbase.c Mon May 4 10:34:34 2015 --- km_dbase.c Thu May 21 09:27:57 2015 *************** *** 140,146 **** return; } if(db_mysql_submit_query(dbc, &p[1])<0) { ! LM_ERR("failed to execute query on async worker\n"); } db_mysql_close(dbc); } --- 140,147 ---- return; } if(db_mysql_submit_query(dbc, &p[1])<0) { ! LM_ERR("failed to execute query [%.*s] on async worker\n", ! p[1].len, p[1].s); } db_mysql_close(dbc); }
Yes, you can commit.
The only thing I may consider is checking the length of query not to be very big and print only first 100 chars or so in that case, like:
LM_ERR("failed to execute query [%.*s] on async worker\n", (p[1].len>100)?100:p[1].len, p[1].s);
It would be probably enough to detect which query was, last part being the values which can be large if one wants to insert full message content via sqlops, for example.
Cheers, Daniel
On 21/05/15 08:35, Juha Heinanen wrote:
Daniel-Constantin Mierla writes:
perhaps the log in db_mysql_async_exec_task() can be easily extended to print more details.
looks like it. i made the change below. is it ok to commit the diff?
-- juha
*** /usr/src/orig/kamailio/modules/db_mysql/km_dbase.c Mon May 4 10:34:34 2015 --- km_dbase.c Thu May 21 09:27:57 2015
*** 140,146 **** return; } if(db_mysql_submit_query(dbc, &p[1])<0) { ! LM_ERR("failed to execute query on async worker\n"); } db_mysql_close(dbc); } --- 140,147 ---- return; } if(db_mysql_submit_query(dbc, &p[1])<0) { ! LM_ERR("failed to execute query [%.*s] on async worker\n", ! p[1].len, p[1].s); } db_mysql_close(dbc); }