[mythtv-commits] Ticket #7603: mythfrontend can never connect to just waked up master backend
MythTV
mythtv at cvs.mythtv.org
Wed Nov 18 18:36:25 UTC 2009
#7603: mythfrontend can never connect to just waked up master backend
-------------------------------------+--------------------------------------
Reporter: bam <mybigspam@…> | Owner: ijr
Type: defect | Status: new
Priority: minor | Milestone: unknown
Component: MythTV - General | Version: unknown
Severity: medium | Mlocked: 0
-------------------------------------+--------------------------------------
If for some reason frontend has no connection to the backend program, the
frontend tries to re-establish it by waking up server/restarting
backend/etc, but it can never to re-connect to it, even if the backend was
successfully back online.[[BR]]
The frontend's log when the master backend on the same machine is not
running:
{{{
2009-11-18 20:54:45.388 Loading menu theme from
/usr/share/mythtv/themes/defaultmenu//mainmenu.xml
2009-11-18 20:54:45.411 Found mainmenu.xml for theme 'Retro'
2009-11-18 20:54:46.656 MythContext: Connecting to backend server:
192.168.1.2:6543 (try 1 of 15)
master_wake
2009-11-18 20:54:46.795 MythContext: Connecting to backend server:
192.168.1.2:6543 (try 2 of 15)
2009-11-18 20:54:46.796 MythContext: Wake-On-Lan in progress, waiting...
2009-11-18 20:54:47.796 MythContext: Wake-On-Lan in progress, waiting...
2009-11-18 20:54:48.797 MythContext: Wake-On-Lan in progress, waiting...
2009-11-18 20:54:49.797 MythContext: Wake-On-Lan in progress, waiting...
2009-11-18 20:54:50.798 MythContext: Wake-On-Lan in progress, waiting...
}}}
...and so on.[[BR]]
I have the "WOLbackendCommand" setting set to "echo master_wake" for
debug, but even if I restart the backend by hand, nothing is changed in
the log.[[BR]]
The reason is that WaitForWOL() function from libs/libmyth/mythcontext.cpp
file can never return:
{{{
bool MythContextPrivate::WaitForWOL(int timeout_in_ms)
{
int timeout_remaining = timeout_in_ms;
while (WOLInProgress && (timeout_remaining > 0))
{
VERBOSE(VB_GENERAL, LOC + "Wake-On-Lan in progress, waiting...");
int max_wait = min(1000, timeout_remaining);
WOLInProgressWaitCondition.wait(
&WOLInProgressLock, max_wait);
timeout_remaining -= max_wait;
}
return !WOLInProgress;
}
}}}
I think this is because there is no threads actually created for the WOL
process, and the following code from mythcontext.cpp can never get
control:
{{{
01679 if (we_attempted_wol)
01680 {
01681 QMutexLocker locker(&d->WOLInProgressLock);
01682 d->WOLInProgress = false;
01683 d->WOLInProgressWaitCondition.wakeAll();
01684 }
}}}
--
Ticket URL: <http://svn.mythtv.org/trac/ticket/7603>
MythTV <http://www.mythtv.org/>
MythTV
More information about the mythtv-commits
mailing list