[mythtv] [BUG?] Endless waiting for thread...

Kevin Kuphal kuphal at dls.net
Tue Mar 8 04:28:16 UTC 2005


RH9
MythTV CVS (as of yesterday)
Remote frontend

This may have happened when I killed my remote frontend as I prepared to 
upgrade to today's CVS on it.  The backend went into and endless loop of:

2005-03-07 21:37:35.423 unknown socket
2005-03-07 21:38:01.197 unknown socket
2005-03-07 21:38:09.456 waiting for a thread..
2005-03-07 21:38:09.481 waiting for a thread..
2005-03-07 21:38:09.514 waiting for a thread..
2005-03-07 21:38:09.543 waiting for a thread..
2005-03-07 21:38:09.573 waiting for a thread..
[snip]
2005-03-07 22:21:35.556 waiting for a thread..
2005-03-07 22:21:35.586 waiting for a thread..
2005-03-07 22:21:35.646 waiting for a thread..

Until I killed it with a restart.  During this time I had restarted the 
frontend a number of times but would not get a response from the backend 
due to it being caught in that loop.  It was definitely caught in 
readSocket from the backend:

void MainServer::readSocket(void)
{
    RefSocket *socket = (RefSocket *)sender();

    PlaybackSock *testsock = getPlaybackBySock(socket);
    if (testsock && testsock->isExpectingReply())
        return;

    readReadyLock.lock();

    ProcessRequestThread *prt = NULL;
    while (!prt)
    {
        threadPoolLock.lock();
        if (!threadPool.empty())
        {
            prt = threadPool.back();
            threadPool.pop_back();
        }
        threadPoolLock.unlock();

        if (!prt)
        {
            VERBOSE(VB_ALL, "waiting for a thread..");
            usleep(50);
        }
    }

    prt->setup(socket);

    readReadyLock.unlock();
}

I'm not familiar enough with that code to know why it got stuck in there 
but maybe someone else can see a way that could get a backend out of 
that endless looping situation.  Thanks.

Kevin


More information about the mythtv-dev mailing list