vdr-1.5.1 & problems with the new shutdown code

Message ID 45EB1E84.20803@gmx.de
State New
Headers

Commit Message

Udo Richter March 4, 2007, 7:31 p.m. UTC
  Rolf Ahrenberg wrote:
> On Sun, 4 Mar 2007, Udo Richter wrote:
> Mar  4 18:31:14 xxx vdr: [6740] LastActivity: Never
> Mar  4 18:31:14 xxx vdr: [6740] ActiveTimeout:   2104
> Mar  4 18:31:14 xxx vdr: [6740] Retry:  Never
> 
> ... goes on and on and no shutdown attempts...

Found it! And, more important: Blame Klaus! :)

Klaus changed the meaning of cRemote::LastActivity() before integrating 
it, and missed to adapt one call to it, the cRemote::LastActivity() > 
ACTIVITYTIMEOUT check before doing housekeeping. And after startup, 
cRemote::LastActivity() will return 0, blocking all housekeeping. 
Correct is (time(NULL) - cRemote::LastActivity()) > ACTIVITYTIMEOUT, as 
in the attached patch.

Cheers,

Udo
  

Comments

Marko Mäkelä March 4, 2007, 7:41 p.m. UTC | #1
On Sun, Mar 04, 2007 at 08:31:16PM +0100, Udo Richter wrote:
> Rolf Ahrenberg wrote:
> >On Sun, 4 Mar 2007, Udo Richter wrote:
> >Mar  4 18:31:14 xxx vdr: [6740] LastActivity: Never
> >Mar  4 18:31:14 xxx vdr: [6740] ActiveTimeout:   2104
> >Mar  4 18:31:14 xxx vdr: [6740] Retry:  Never
> >
> >... goes on and on and no shutdown attempts...
> 
> Found it! And, more important: Blame Klaus! :)
> 
> Klaus changed the meaning of cRemote::LastActivity() before integrating 
> it, and missed to adapt one call to it, the cRemote::LastActivity() > 
> ACTIVITYTIMEOUT check before doing housekeeping. And after startup, 
> cRemote::LastActivity() will return 0, blocking all housekeeping. 
> Correct is (time(NULL) - cRemote::LastActivity()) > ACTIVITYTIMEOUT, as 
> in the attached patch.

That explains why I haven't had any problems with this, with any version
of your shutdown rewrite patch for vdr 1.4.  It's good to use the stable
version. :-)

	Marko
  
Klaus Schmidinger March 4, 2007, 9:04 p.m. UTC | #2
Udo Richter wrote:
> Rolf Ahrenberg wrote:
>> On Sun, 4 Mar 2007, Udo Richter wrote:
>> Mar  4 18:31:14 xxx vdr: [6740] LastActivity: Never
>> Mar  4 18:31:14 xxx vdr: [6740] ActiveTimeout:   2104
>> Mar  4 18:31:14 xxx vdr: [6740] Retry:  Never
>>
>> ... goes on and on and no shutdown attempts...
> 
> Found it! And, more important: Blame Klaus! :)

It's always good to have somebody to blame ;-)
Especially with such an important feature...

Klaus
  
Rolf Ahrenberg March 6, 2007, 7 a.m. UTC | #3
On Sun, 4 Mar 2007, Udo Richter wrote:

> Found it! And, more important: Blame Klaus! :)

Thanks. You could adapt my finnish translation update to your 1.4.x 
series patch (google: vdr-1.5.1-finnish.diff)...

BR,
--
rofa
  

Patch

Index: vdr.c
===================================================================
--- vdr.c	(Revision 874)
+++ vdr.c	(Arbeitskopie)
@@ -1162,7 +1162,7 @@ 
               ShutdownHandler.countdown.Cancel();
            }
 
-        if (!Interact && !cRecordControls::Active() && !cCutter::Active() && !Interface->HasSVDRPConnection() && cRemote::LastActivity() > ACTIVITYTIMEOUT) {
+        if (!Interact && !cRecordControls::Active() && !cCutter::Active() && !Interface->HasSVDRPConnection() && (time(NULL) - cRemote::LastActivity()) > ACTIVITYTIMEOUT) {
            // Handle housekeeping tasks
 
            // Shutdown: