Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#7696 closed defect (fixed)

no delays between reconnect attempts to master backend

Reported by: bam <mybigspam@…> Owned by: danielk
Priority: major Milestone: unknown
Component: MythTV - General Version: 0.22-fixes
Severity: medium Keywords: timeout, reconnect
Cc: bam Ticket locked: no

Description

If master backend is not available and you run frontend from terminal, you can see that no delays is made between reconnect attempts to master backend:

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)

This is due to incorrect timeout calculation. The fix:

--- libs/libmyth/mythcontext.cpp       (revision 22942)
+++ libs/libmyth/mythcontext.cpp        (working copy)
@@ -1658,7 +1658,7 @@
             }

             myth_system(WOLcmd);
-            sleepms = WOLsleepTime * 1000000;
+            sleepms = WOLsleepTime * 1000;
         }

         serverSock->DownRef();
@@ -1671,7 +1671,7 @@
         }

         if (sleepms)
-            usleep(sleepms / 1000);
+            usleep(sleepms * 1000);
     }

     if (we_attempted_wol)

Also please see #7603.

Change History (4)

comment:1 Changed 14 years ago by danielk

Owner: changed from Isaac Richards to danielk
Status: newassigned

comment:2 Changed 14 years ago by danielk

(In [22958]) Refs #7696. Reconnect frontend to backend after disconnects.

This normally happens immediately after you try to do something in the frontend after a disconnect, but there are two problems. First, this can take a couple seconds, this gives the frontend the appearance of slugishness. Second, since we didn't know of the disconnect we didn't know to reload our entries in the Watch Recordings screen.

We may want to do some tweaking of the timeouts, but I want to address #7696 first; trac wasn't behaving so I couldn't look at the ticket tonight...

comment:3 Changed 14 years ago by danielk

Resolution: fixed
Status: assignedclosed

(In [22979]) Fixes #7696. Fix a couple related math errors in sleep between reconnects code.

comment:4 Changed 14 years ago by bam <mybigspam@…>

Thank you, danielk. Could you also check the #7603? It seems that your code causing problems there.

Note: See TracTickets for help on using tickets.