Bug with scheduling

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Bug with scheduling

Clive Bruton
I've reported this bug with 8.1, it seems that it still exists in 8.5.1:

Custom scheduled events don't execute as they should

I've scheduled an event as follows:

        Event: http://server.com/?do.stuff
        Next Execute: 09/04/2006 18:22:30 -- MM/DD/YYYY HH:MM:SS
        Options: Repeat Every 5 Minutes

This executes, as expected, but after the first execution the status  
reads:

        Event: http://server.com/?do.stuff
        Next Execute: 04/09/2006 00:07:30 -- DD/MM/YYYY HH:MM:SS!?
        Options: Repeat Every 5 Minutes

The status does not get updated from that point, but the request  
executes every 60 seconds from that point onwards (I can see the  
requests in the server logs). If I pause the schedule the execution  
stops, if I resume the schedule it starts hitting every 60 seconds  
again. The "Next Execute never gets updated (and is in the past,  
whether you think it's supposed to be 9 April or 4 September).


-- Clive

------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: Bug with scheduling

Clive Bruton

On 4 Sep 2006, at 18:41, Clive Bruton wrote:

> I've reported this bug with 8.1, it seems that it still exists in  
> 8.5.1:

So, is this just me, or is it Memorex (ie, a real bug)?


-- Clive

------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: Bug with scheduling

Marc Vos-3
In reply to this post by Clive Bruton
Hi Clive,

I use custom scheduling since I have Lasso and haven't had any  
problems with it, not in 7, 8, 8.1 and 8.5.1.

This is one of mine, which executes every 5 minutes:

        Event: http://127.0.0.1/~user/site/site-import.lasso
        Next Execute: 09/05/2006 12:45:53
        User: adminuser
        Options: Repeat Every 5 Minutes

After 5 minutes it reads:

        Event: http://127.0.0.1/~user/site/site-import.lasso
        Next Execute: 09/05/2006 12:50:53
        User: adminuser
        Options: Repeat Every 5 Minutes


Date format is US (default for Lasso I presume?) and it doesn't change.


Regards,
-Marc Vos

* * * * * * * * * * * * * * * * * * * * * * * *
Goodyear Dunlop Tires Germany GmbH
Private:  http://marc.vos.net/
iChat/AIM : mhevos
* * * * * * * * * * * * * * * * * * * * * * * *



On 04-sep-2006, at 19:41, Clive Bruton wrote:

> I've reported this bug with 8.1, it seems that it still exists in  
> 8.5.1:
>
> Custom scheduled events don't execute as they should
>
> I've scheduled an event as follows:
>
> Event: http://server.com/?do.stuff
> Next Execute: 09/04/2006 18:22:30 -- MM/DD/YYYY HH:MM:SS
> Options: Repeat Every 5 Minutes
>
> This executes, as expected, but after the first execution the  
> status reads:
>
> Event: http://server.com/?do.stuff
> Next Execute: 04/09/2006 00:07:30 -- DD/MM/YYYY HH:MM:SS!?
> Options: Repeat Every 5 Minutes
>
> The status does not get updated from that point, but the request  
> executes every 60 seconds from that point onwards (I can see the  
> requests in the server logs). If I pause the schedule the execution  
> stops, if I resume the schedule it starts hitting every 60 seconds  
> again. The "Next Execute never gets updated (and is in the past,  
> whether you think it's supposed to be 9 April or 4 September).
>
>
> -- Clive
>
> ------------------------------
> Lasso Support: http://support.omnipilot.com/
> Search the list archives: http://www.listsearch.com/lassotalk.lasso
> Manage your list subscription: http://www.listsearch.com/ 
> lassotalk.lasso?manage


------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: Bug with scheduling

Clive Bruton

On 5 Sep 2006, at 11:51, Marc Vos wrote:

> Date format is US (default for Lasso I presume?) and it doesn't  
> change.

I guess I have to do some source digging or something. Thanks.


-- Clive

------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: Bug with scheduling - gotcha!

Clive Bruton
Ok, I think I have the bug:

scheduleLibrary.lasso:

        line 240: local: 'date_fix' = (Date)->(Difference: (String: (Date)),  
-MinutesBetween);

and

        line 414: local: 'date_fix' = (Date)->(Difference: (String:  
(Date)), -MinutesBetween);

Now, I couldn't really figure out what this variable is supposed to  
do, but it seems that it's always going to get a value of "0" (the  
time difference, in minutes, between the date "now" and the date  
"now" plus a couple of milliseconds!?).

One odd thing that strikes me about it is that a date is being cast  
as a string for a comparison with a date - I suppose there was some  
logic to it when it was initially coded, perhaps something to do with  
the reason it's there in the first place. The 8.5 reference give the  
example:

        [$MyDate->(Difference: (Date: '5/15/2002 01:30:00'))]

Which is a date type being compared with a date type. There's no -
MinutesBetween parameter listed (I suppose that's the older version  
of "-Minute").

Now, for most of you this is going to work out fine and dandy. But,  
because I'm not living in the USA, I don't really appreciate the  
default date format of "MM/DD/YYYY", so in my Lasso startup folder is  
the following:

        [Date_SetFormat: -Format='%d/%m/%Y']

(The more astute of you are ahead of me already, so just scroll to  
the bottom.)

What this means is that for the scheduleLibrary.lasso code above a  
date type something like:

        2006-09-06 03:30:00

Is being compared to a string like:

        06/09/2006 (00:00:00)

Where the coders who had originally written scheduleLibrary.lasso had  
expected something like:

        09/06/2006 03:30:00

The latter of which Lasso will automatically recognise as a date. Or  
rather, as something resembling the expected date.

This tends to mess up Lasso's scheduling a little.

Now the fix is pretty simple (both lines):

        local: 'date_fix' = (Date)->(Difference: (date_format: (Date), -
format='%m/%d/%Y %H:%M:%S'), -MinutesBetween);

or even just:

        local: 'date_fix' = (Date)->(Difference: (Date), -MinutesBetween);
       
(But, like I wrote above, no idea what that's supposed to achieve.)

So, the question on everyone's lips is:

        Is this a luser error, or is this a bug?

I think it's a bug:

        The code I have as a startup item is "proper" Lasso code, and  
shouldn't be expected
        to trip up Lasso's integral processes.

        I think that if you're going to try to parse a string as a date then  
you should be
        explicit about what you are expecting, especially if you are going  
to perform some
        kind of function on such.

So, if this could be "fixed" I would appreciate it, you could also  
amend the following lines to:

        line 419: log_detail: 'Schedule: Rescheduling to ' + (date_format:
(local: 'next_execute'), -format='%Q %T');

        line 447: Log_Detail: 'Schedule: Sleeping Until ' + (date_format:
(global: '__Schedule_Sleep__'), -format='%Q %T');

Thanks


-- Clive

------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: Bug with scheduling - gotcha!

Bil Corry-3
Too bad more of Lasso isn't open-source.

- Bil

Clive Bruton wrote:

> Ok, I think I have the bug:
>
> scheduleLibrary.lasso:
>
>     line 240:    local: 'date_fix' = (Date)->(Difference: (String:
> (Date)), -MinutesBetween);
>
> and
>
>     line 414:     local: 'date_fix' = (Date)->(Difference: (String:
> (Date)), -MinutesBetween);
>
> Now, I couldn't really figure out what this variable is supposed to do,
> but it seems that it's always going to get a value of "0" (the time
> difference, in minutes, between the date "now" and the date "now" plus a
> couple of milliseconds!?).
>
> One odd thing that strikes me about it is that a date is being cast as a
> string for a comparison with a date - I suppose there was some logic to
> it when it was initially coded, perhaps something to do with the reason
> it's there in the first place. The 8.5 reference give the example:
>
>     [$MyDate->(Difference: (Date: '5/15/2002 01:30:00'))]
>
> Which is a date type being compared with a date type. There's no
> -MinutesBetween parameter listed (I suppose that's the older version of
> "-Minute").
>
> Now, for most of you this is going to work out fine and dandy. But,
> because I'm not living in the USA, I don't really appreciate the default
> date format of "MM/DD/YYYY", so in my Lasso startup folder is the
> following:
>
>     [Date_SetFormat: -Format='%d/%m/%Y']
>
> (The more astute of you are ahead of me already, so just scroll to the
> bottom.)
>
> What this means is that for the scheduleLibrary.lasso code above a date
> type something like:
>
>     2006-09-06 03:30:00
>
> Is being compared to a string like:
>
>     06/09/2006 (00:00:00)
>
> Where the coders who had originally written scheduleLibrary.lasso had
> expected something like:
>
>     09/06/2006 03:30:00
>
> The latter of which Lasso will automatically recognise as a date. Or
> rather, as something resembling the expected date.
>
> This tends to mess up Lasso's scheduling a little.
>
> Now the fix is pretty simple (both lines):
>
>     local: 'date_fix' = (Date)->(Difference: (date_format: (Date),
> -format='%m/%d/%Y %H:%M:%S'), -MinutesBetween);
>
> or even just:
>
>     local: 'date_fix' = (Date)->(Difference: (Date), -MinutesBetween);
>    
> (But, like I wrote above, no idea what that's supposed to achieve.)
>
> So, the question on everyone's lips is:
>
>     Is this a luser error, or is this a bug?
>
> I think it's a bug:
>
>     The code I have as a startup item is "proper" Lasso code, and
> shouldn't be expected
>     to trip up Lasso's integral processes.
>
>     I think that if you're going to try to parse a string as a date then
> you should be
>     explicit about what you are expecting, especially if you are going
> to perform some
>     kind of function on such.
>
> So, if this could be "fixed" I would appreciate it, you could also amend
> the following lines to:
>
>     line 419:    log_detail: 'Schedule: Rescheduling to ' +
> (date_format:(local: 'next_execute'), -format='%Q %T');
>
>     line 447:    Log_Detail: 'Schedule: Sleeping Until ' +
> (date_format:(global: '__Schedule_Sleep__'), -format='%Q %T');
>
> Thanks
>
>
> -- Clive


------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: Bug with scheduling - gotcha!

Clive Bruton

On 6 Sep 2006, at 07:12, Bil Corry wrote:

> Too bad more of Lasso isn't open-source.

Right, it would have been impossible for me to track it down  
otherwise. It was pretty hard to test it, because it's part of the  
start-up app, but I found a way to do it (rename the tags in there,  
modify and add log lines, hit the scheduleLibrary.lasso file directly  
with a browser and run Lasso in console mode).

The alternative would have been to modify the source and build the  
app again, which would have been a somewhat lengthier process.

But at least the option to do all of this is there.


-- Clive

------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage