<div dir="ltr">I also experienced a lockup using realtime postgres. I this what you are doing? ou do not describe your environment in much detail.<div><br></div><div>If so, have you seen this patch which is in GIT for asterisk 11?</div><div><br></div><div><div>diff --git a/res/res_config_pgsql.c b/res/res_config_pgsql.c</div><div>index be2d4ed..bce7394 100644</div><div>--- a/res/res_config_pgsql.c</div><div>+++ b/res/res_config_pgsql.c</div><div>@@ -335,7 +335,9 @@ static struct tables *find_table(const char *database, const char *orig_tablenam</div><div> ast_str_set(&sql, 0, "SELECT a.attname, t.typname, a.attlen, a.attnotnull, d.adsrc, a.atttypmod FROM pg_class c, pg_type t, pg_attribute a LEFT OUTER JOIN pg_attrdef d ON a.atthasdef AND d.adrelid = a.attrelid AND d.adnum</div><div> }</div><div> </div><div>+ ast_mutex_lock(&pgsql_lock);</div><div> exec_result = pgsql_exec(database, orig_tablename, ast_str_buffer(sql), &result);</div><div>+ ast_mutex_unlock(&pgsql_lock);</div><div> ast_debug(1, "Query of table structure complete. Now retrieving results.\n");</div><div> if (exec_result != 0) {</div><div> ast_log(LOG_ERROR, "Failed to query database columns for table %s\n", orig_tablename);</div><div>@@ -1371,6 +1373,9 @@ static int unload_module(void)</div><div> ast_config_engine_deregister(&pgsql_engine);</div><div> ast_verb(1, "PostgreSQL RealTime unloaded.\n");</div><div> </div><div>+ /* Unlock so something else can destroy the lock. */</div><div>+ ast_mutex_unlock(&pgsql_lock);</div><div>+</div><div> /* Destroy cached table info */</div><div> AST_LIST_LOCK(&psql_tables);</div><div> while ((table = AST_LIST_REMOVE_HEAD(&psql_tables, list))) {</div><div>@@ -1378,9 +1383,6 @@ static int unload_module(void)</div><div> }</div><div> AST_LIST_UNLOCK(&psql_tables);</div><div> </div><div>- /* Unlock so something else can destroy the lock. */</div><div>- ast_mutex_unlock(&pgsql_lock);</div><div>-</div><div> return 0;</div><div> }</div></div><div><br></div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr">On Fri, 30 Oct 2015 at 20:56 Mark Murawski <<a href="mailto:markm-lists@intellasoft.net">markm-lists@intellasoft.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 10/30/15 16:04, Mark Murawski wrote:<br>
> I'm getting the following lockup very randomly in 11.20. This is pretty<br>
> devastating to one of my production systems.<br>
><br>
> =======================================================================<br>
> === 11.20.0<br>
> === Currently Held Locks<br>
> =======================================================================<br>
> .... snip<br>
<br>
If this helps figure out the problem, I've added the following code to<br>
db.c, ast_db_put() and this appears to have alleviated the lockup<br>
<br>
{<br>
int attempts = 10;<br>
<br>
while (ast_mutex_trylock(&dblock) != 0) {<br>
// didn't lock<br>
attempts--;<br>
usleep(100);<br>
<br>
if (attempts <= 0) {<br>
ast_log(LOG_ERROR, "ast_db_put() COULD<br>
NOT LOCK. Abandon.\n");<br>
return -1;<br>
}<br>
}<br>
}<br>
<br>
Now my logs are filling up with could not lock, but at least I'm not<br>
locking up entirely anymore.<br>
<br>
--<br>
_____________________________________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" rel="noreferrer" target="_blank">http://www.api-digital.com</a> --<br>
<br>
asterisk-dev mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
<a href="http://lists.digium.com/mailman/listinfo/asterisk-dev" rel="noreferrer" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-dev</a><br>
</blockquote></div>