[mythtv] [mythtv-commits] Ticket #2011: Backend deadlock, multiple delete threads waiting on mutex.

Jim Westfall jwestfall at surrealistic.net
Sun Jul 2 18:33:33 UTC 2006


> 
> Comment:
> 
>  Not a bug.
> 
>  These threads are waiting for their turn. Only one delete proceeds at a
>  time so we can rate limit deletes. If a large file delete happens due to
>  an auto-expire or user request and then you do a lot of channel flipping,
>  many small deletes will bunch up waiting for the delete lock. Within a few
>  minutes they will all get their turn and execute quickly.
> 

I think there is a bug here, he's actually running out of database 
connections.

MainServer::DoDeleteThread() {
  ...
  MSqlQuery query(MSqlQuery::InitCon());
  ...
  TruncateAndClose(m_expirer, fd, ds->filename);
}

A database connection is allocated and wont be released until DoDeleteThread() 
returns.  With enough deletes blocked waiting to be TruncateAndClosed()'d 
it will eat up all database connections.

jim


More information about the mythtv-dev mailing list