mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-09 14:36:48 +00:00
We have faced situation when using CDR and CEL by sqlite3 modules. With system having high load (~100 concurrent calls created by sipp) we found many cdr and cel records missed. There is special finction in sqlite3, that make able to fix this situation - sqlite3_wait_timeout, that also can replace awful code cdr_sqlite3 ad cel_sqlite3 modules. Also this function can be used for aastdb and res_config_sqlite3 to avoid missed writes to sqlite db.
#ASTERISK-23766 #close Reported by: Igor Goncharovsky Review: https://reviewboard.asterisk.org/r/3559/ ........ Merged revisions 416336 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 416337 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@416338 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -257,6 +257,7 @@ static int db_open(void)
|
||||
ast_mutex_unlock(&dblock);
|
||||
return -1;
|
||||
}
|
||||
|
||||
ast_mutex_unlock(&dblock);
|
||||
|
||||
return 0;
|
||||
@@ -283,9 +284,8 @@ static int db_execute_sql(const char *sql, int (*callback)(void *, int, char **,
|
||||
char *errmsg = NULL;
|
||||
int res =0;
|
||||
|
||||
sqlite3_exec(astdb, sql, callback, arg, &errmsg);
|
||||
if (errmsg) {
|
||||
ast_log(LOG_WARNING, "Error executing SQL: %s\n", errmsg);
|
||||
if (sqlite3_exec(astdb, sql, callback, arg, &errmsg) != SQLITE_OK) {
|
||||
ast_log(LOG_WARNING, "Error executing SQL (%s): %s\n", sql, errmsg);
|
||||
sqlite3_free(errmsg);
|
||||
res = -1;
|
||||
}
|
||||
|
Reference in New Issue
Block a user