mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-03-05 02:02:01 +00:00
deal with handles being released incorrectly
This commit is contained in:
parent
5ca8cf7d8e
commit
c50336b1f8
@ -209,6 +209,7 @@ static void sql_close(time_t prune)
|
|||||||
{
|
{
|
||||||
switch_cache_db_handle_t *dbh = NULL;
|
switch_cache_db_handle_t *dbh = NULL;
|
||||||
int locked = 0;
|
int locked = 0;
|
||||||
|
int sanity = 10000;
|
||||||
|
|
||||||
switch_mutex_lock(sql_manager.dbh_mutex);
|
switch_mutex_lock(sql_manager.dbh_mutex);
|
||||||
top:
|
top:
|
||||||
@ -254,7 +255,12 @@ static void sql_close(time_t prune)
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
if (!prune) {
|
if (!prune) {
|
||||||
locked++;
|
if (!sanity) {
|
||||||
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "SANITY CHECK FAILED! Handle %s (%s;%s) was not properly released.\n",
|
||||||
|
dbh->name, dbh->creator, dbh->last_user);
|
||||||
|
} else {
|
||||||
|
locked++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -262,6 +268,10 @@ static void sql_close(time_t prune)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (locked) {
|
if (locked) {
|
||||||
|
if (!prune) {
|
||||||
|
switch_cond_next();
|
||||||
|
if (sanity) sanity--;
|
||||||
|
}
|
||||||
goto top;
|
goto top;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user