From: Anthony Minessale Date: Wed, 31 Oct 2012 15:31:23 +0000 (-0500) Subject: deal with handles being released incorrectly X-Git-Tag: v1.3.1~26 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c50336b1f82c5c38529a4e2ddfba1d8d55fc896d;p=thirdparty%2Ffreeswitch.git deal with handles being released incorrectly --- diff --git a/src/switch_core_sqldb.c b/src/switch_core_sqldb.c index ba3f116d3c..ac32d7d146 100644 --- a/src/switch_core_sqldb.c +++ b/src/switch_core_sqldb.c @@ -209,6 +209,7 @@ static void sql_close(time_t prune) { switch_cache_db_handle_t *dbh = NULL; int locked = 0; + int sanity = 10000; switch_mutex_lock(sql_manager.dbh_mutex); top: @@ -254,7 +255,12 @@ static void sql_close(time_t prune) } else { 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; } @@ -262,6 +268,10 @@ static void sql_close(time_t prune) } if (locked) { + if (!prune) { + switch_cond_next(); + if (sanity) sanity--; + } goto top; }