You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Andreas Hochsteger <e9...@student.tuwien.ac.at> on 2003/09/01 07:57:02 UTC
Re: CommandManager issues [was Re: Releasing 2.1.1?]
Hi!
Just in case you didn't know:
Did you have a look at the Quartz Scheduler?
http://www.part.net/quartz.html
http://www.part.net/quartz_features.html
Perhaps it already does what you need.
It's licensed under a BSD and Apache-Style license.
Here's another one:
http://jcrontab.sourceforge.net/
I found the links on this page:
http://wiki.cocoondev.org/Wiki.jsp?page=WyonaScheduler
Bye,
Andreas
Giacomo Pati wrote:
> On Sun, 31 Aug 2003, Bruno Dumon wrote:
>
>
>>On Sun, 2003-08-31 at 20:38, Giacomo Pati wrote:
>>
>>>First, if you look at the Cornerstone Scheduler you'll see that the
>>>ability to define repeated tasks are somehow limited. Business apps can
>>>easily request administration tasks to be run twice a day on work days.
>>>To define this with the Cornerstone Scheduler you'll need to add 10
>>>'cron' entries to it. This is why I'd like to extend it using the unix
>>>cron direction to define ranges and list of timing aspects. But then
>>>you're faced with the problem of defining sleep time for efficient use
>>>(which you need to be able to cooperate in the Cornerstone Scheduler
>>>machinery).
>>>
>>>The unix cron daemon runs every minute to check if there are any jobs to
>>>run. It checks initially creating bitsets for the minute, hour, day,
>>>month, and weekday definition for each task. This makes it easy to
>>>check whether a task has to be launched. I still haven't found an
>>>algorithm (and I think there isn't an easy one available) to determine
>>>the sleep time until the next task is due.
>>
>>Ah, didn't think that far.
>>
>>
>>> Thus, a check every minute
>>>isn't much but still 1440 times a day.
>>
>>But a lot less then the 864000 times a day in case of a check every 100
>>ms :-)
>
>
> Sure.
>
>
>>>The other thing to respect if you'd like to go as efficent as possible
>>>is the determination of Threads you'll need to run each cron task at the
>>>time specified. But this needs knowledge about how much elapsed time a
>>>task need to run to decide if you need one or two thread to complete to
>>>task defined neat in time to each other. If you have an algorithm for
>>>this you'll be able to define the maximum numbers of Thread you'll need.
>>>Otherwise you allocate a separate Thread per defined task.
>>>
>>>The consequences are that probably the easiest solution to a (more or
>>>less) complete Cron like Scheduler is an own heart beat of one minute to
>>>check for task to launch and a pool of Threads as big as you have task
>>>to process. As it seems Doug Leas concurrency tools could be configured
>>>to be as resource sparing as possible (have a look at
>>>http://gee.cs.oswego.edu/dl/classes/EDU/oswego/cs/dl/util/concurrent/PooledExecutor.html)
>>
>>Yep, I think that will be fine too.
>
>
> Ok, so I'll gona build up a Scheduler based on its own heart beat (own
> Thread) with Crond expressions for timing specifications that uses a
> PooledExecutor for the Triggers in the size of the numbers of Task
> defined in the configuration but with lazy construction of Thread
> objects. This will not need any additional jars and the ones introduced
> by the Cornerstone Sccheduler can be eliminated again. Is everybody
> happy with that?
>
> --
> Giacomo Pati
> Otego AG, Switzerland - http://www.otego.com
> Orixo, the XML business alliance - http://www.orixo.com
>
>
RE: CommandManager issues [was Re: Releasing 2.1.1?]
Posted by Bruno Dumon <br...@outerthought.org>.
On Tue, 2003-09-02 at 12:48, Giacomo Pati wrote:
> On Mon, 1 Sep 2003, Bruno Dumon wrote:
>
> > On Mon, 2003-09-01 at 16:29, Giacomo Pati wrote:
> > > On Mon, 1 Sep 2003, Bruno Dumon wrote:
> > >
> > > > On Mon, 2003-09-01 at 11:37, Giacomo Pati wrote:
> > > > > On Mon, 1 Sep 2003, Reinhard Poetz wrote:
> > > > >
> > > > > >
> > > > > >
> > > > > > On Behalf Of Giacomo Pati
> > > > > >
> > > > > > > On Mon, 1 Sep 2003, Andreas Hochsteger wrote:
> > > > > > >
> > > > > > > > Hi!
> > > > > > > >
> > > > > > > > Just in case you didn't know:
> > > > > > > > Did you have a look at the Quartz Scheduler?
> > > > > > > > http://www.part.net/quartz.html
> > > > > > > > http://www.part.net/quartz_features.html
> > > > > > > > Perhaps it already does what you need.
> > > > > > > > It's licensed under a BSD and Apache-Style license.
> > > > > > >
> > > > > > > I've seen it some time ago but thought it is quite too much
> > > > > > > for a simple cron mechanism we are discussing here.
> > > > > > >
> > > > > > > Any other thoughts?
> > > > > >
> > > > > > Do you think it is difficult to use/to integrate? From the features list
> > > > > > it is exactly what we need, isn't it?
> > > > >
> > > > > IMHO, from the feature list it is way too much we need, isn't it?
> > > >
> > > > I think many of it are optional features, and those extra features might
> > > > come in handy some day. If it does everything we need and if it's solid,
> > > > why not use it?
> > >
> > > Hmm, the cocurrency util from Doug Lea does alot Quartz offers.
> >
> > Hmm, as far as I know, only the threadpool? (which is of course an
> > important part). Quartz has either a very simple thread pool of its own
> > or otherwise uses something from jakarta commons. I think it would be
> > easy to put PooledExecutor behind it.
>
> Ok, I've rewritten the Scheduler using Quartz as scheduling engine (and
> using its CronTrigger class) but put an PooledExecutor underneath as the
> ThreadPool.
>
> > > So my
> > > oppinion was not to add another dependency.
> >
> > Sometimes it sounds more compelling to add another dependency maintained
> > by another community than to add more code to Cocoon.
>
> Ok, convinced :-)
>
> > > Quartz (if I've read the
> > > feature list correctly) doesn't offer Cron spec parsing,
> >
> > Hope you look a bit further than the first web page to judge a piece of
> > software (imagine if people would do that for cocoon...)
>
> Sorry, yes now I've seen it and it has quite more feature as my
> implementation.
>
> > See this:
> > http://quartz.sourceforge.net/javadoc/org/quartz/CronTrigger.html
> >
> > Furthermore, from having a quick look, quartz is quite modular, with
> > different implementations available, in its simplest form without any
> > third party jars requirements.
>
> Yup. I've seen.
>
> >
> > It also seems to be able to calculate the time to perform to the next
> > task to be performed.
> >
> > > so we have to
> > > do it anyway. And because I've alread done this for another project some
> > > times ago I thought to but it into a Scheduler by it own (mean in the
> > > org.apache.cocoon package space).
> > >
> > > So, the scheduler I've proposed is already done. I just have to
> > > repackage it and add some more javadocs etc. It's about to be ready to
> > > be committed tomorrow.
> > >
> > > If there are still objection I hold on the commits until we reached
> > > consensus.
> >
> > I have two more questions:
> >
> > * what do we need a scheduler for in Cocoon in the first place?
> >
> > * would your scheduler be able to handle the ContinuationsManager
> > cleanup task? The specific requirement I'm thinking of is that it
> > shouldn't be launched concurrently, so if the previous cleanup is still
> > running it shouldn't be launched a second time.
>
> The interface for a Scheduler so far isn't complete but, yes, The
> ContinuationsManager could launch it's own jobs as the Scheduler is
> implemented as a regular Avalon component.
>
> I've also implemented configurable en-/disable parallel runs.
ok. Sounds all nice and good.
One open point now is what the scheduler is needed for. I mean, the
ContinuationsManager cleanup task doesn't have any fancy cron scheduling
needs, and could be run as well by the CommandManager (which I think is
present anyway in fortress to manage component pool sizes
assynchronously, so might as well be used).
This would remove the requirement to put the scheduler into the core, so
that it could be put in a block.
--
Bruno Dumon http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
bruno@outerthought.org bruno@apache.org
RE: CommandManager issues [was Re: Releasing 2.1.1?]
Posted by Giacomo Pati <gi...@apache.org>.
On Mon, 1 Sep 2003, Bruno Dumon wrote:
> On Mon, 2003-09-01 at 16:29, Giacomo Pati wrote:
> > On Mon, 1 Sep 2003, Bruno Dumon wrote:
> >
> > > On Mon, 2003-09-01 at 11:37, Giacomo Pati wrote:
> > > > On Mon, 1 Sep 2003, Reinhard Poetz wrote:
> > > >
> > > > >
> > > > >
> > > > > On Behalf Of Giacomo Pati
> > > > >
> > > > > > On Mon, 1 Sep 2003, Andreas Hochsteger wrote:
> > > > > >
> > > > > > > Hi!
> > > > > > >
> > > > > > > Just in case you didn't know:
> > > > > > > Did you have a look at the Quartz Scheduler?
> > > > > > > http://www.part.net/quartz.html
> > > > > > > http://www.part.net/quartz_features.html
> > > > > > > Perhaps it already does what you need.
> > > > > > > It's licensed under a BSD and Apache-Style license.
> > > > > >
> > > > > > I've seen it some time ago but thought it is quite too much
> > > > > > for a simple cron mechanism we are discussing here.
> > > > > >
> > > > > > Any other thoughts?
> > > > >
> > > > > Do you think it is difficult to use/to integrate? From the features list
> > > > > it is exactly what we need, isn't it?
> > > >
> > > > IMHO, from the feature list it is way too much we need, isn't it?
> > >
> > > I think many of it are optional features, and those extra features might
> > > come in handy some day. If it does everything we need and if it's solid,
> > > why not use it?
> >
> > Hmm, the cocurrency util from Doug Lea does alot Quartz offers.
>
> Hmm, as far as I know, only the threadpool? (which is of course an
> important part). Quartz has either a very simple thread pool of its own
> or otherwise uses something from jakarta commons. I think it would be
> easy to put PooledExecutor behind it.
Ok, I've rewritten the Scheduler using Quartz as scheduling engine (and
using its CronTrigger class) but put an PooledExecutor underneath as the
ThreadPool.
> > So my
> > oppinion was not to add another dependency.
>
> Sometimes it sounds more compelling to add another dependency maintained
> by another community than to add more code to Cocoon.
Ok, convinced :-)
> > Quartz (if I've read the
> > feature list correctly) doesn't offer Cron spec parsing,
>
> Hope you look a bit further than the first web page to judge a piece of
> software (imagine if people would do that for cocoon...)
Sorry, yes now I've seen it and it has quite more feature as my
implementation.
> See this:
> http://quartz.sourceforge.net/javadoc/org/quartz/CronTrigger.html
>
> Furthermore, from having a quick look, quartz is quite modular, with
> different implementations available, in its simplest form without any
> third party jars requirements.
Yup. I've seen.
>
> It also seems to be able to calculate the time to perform to the next
> task to be performed.
>
> > so we have to
> > do it anyway. And because I've alread done this for another project some
> > times ago I thought to but it into a Scheduler by it own (mean in the
> > org.apache.cocoon package space).
> >
> > So, the scheduler I've proposed is already done. I just have to
> > repackage it and add some more javadocs etc. It's about to be ready to
> > be committed tomorrow.
> >
> > If there are still objection I hold on the commits until we reached
> > consensus.
>
> I have two more questions:
>
> * what do we need a scheduler for in Cocoon in the first place?
>
> * would your scheduler be able to handle the ContinuationsManager
> cleanup task? The specific requirement I'm thinking of is that it
> shouldn't be launched concurrently, so if the previous cleanup is still
> running it shouldn't be launched a second time.
The interface for a Scheduler so far isn't complete but, yes, The
ContinuationsManager could launch it's own jobs as the Scheduler is
implemented as a regular Avalon component.
I've also implemented configurable en-/disable parallel runs.
>
> Other than that, I'll leave it up to your good judgement on what path to
> follow, I don't have any experience with any schedulers anyway...
>
>
--
Giacomo Pati
Otego AG, Switzerland - http://www.otego.com
Orixo, the XML business alliance - http://www.orixo.com
RE: CommandManager issues [was Re: Releasing 2.1.1?]
Posted by Bruno Dumon <br...@outerthought.org>.
On Mon, 2003-09-01 at 16:29, Giacomo Pati wrote:
> On Mon, 1 Sep 2003, Bruno Dumon wrote:
>
> > On Mon, 2003-09-01 at 11:37, Giacomo Pati wrote:
> > > On Mon, 1 Sep 2003, Reinhard Poetz wrote:
> > >
> > > >
> > > >
> > > > On Behalf Of Giacomo Pati
> > > >
> > > > > On Mon, 1 Sep 2003, Andreas Hochsteger wrote:
> > > > >
> > > > > > Hi!
> > > > > >
> > > > > > Just in case you didn't know:
> > > > > > Did you have a look at the Quartz Scheduler?
> > > > > > http://www.part.net/quartz.html
> > > > > > http://www.part.net/quartz_features.html
> > > > > > Perhaps it already does what you need.
> > > > > > It's licensed under a BSD and Apache-Style license.
> > > > >
> > > > > I've seen it some time ago but thought it is quite too much
> > > > > for a simple cron mechanism we are discussing here.
> > > > >
> > > > > Any other thoughts?
> > > >
> > > > Do you think it is difficult to use/to integrate? From the features list
> > > > it is exactly what we need, isn't it?
> > >
> > > IMHO, from the feature list it is way too much we need, isn't it?
> >
> > I think many of it are optional features, and those extra features might
> > come in handy some day. If it does everything we need and if it's solid,
> > why not use it?
>
> Hmm, the cocurrency util from Doug Lea does alot Quartz offers.
Hmm, as far as I know, only the threadpool? (which is of course an
important part). Quartz has either a very simple thread pool of its own
or otherwise uses something from jakarta commons. I think it would be
easy to put PooledExecutor behind it.
> So my
> oppinion was not to add another dependency.
Sometimes it sounds more compelling to add another dependency maintained
by another community than to add more code to Cocoon.
> Quartz (if I've read the
> feature list correctly) doesn't offer Cron spec parsing,
Hope you look a bit further than the first web page to judge a piece of
software (imagine if people would do that for cocoon...)
See this:
http://quartz.sourceforge.net/javadoc/org/quartz/CronTrigger.html
Furthermore, from having a quick look, quartz is quite modular, with
different implementations available, in its simplest form without any
third party jars requirements.
It also seems to be able to calculate the time to perform to the next
task to be performed.
> so we have to
> do it anyway. And because I've alread done this for another project some
> times ago I thought to but it into a Scheduler by it own (mean in the
> org.apache.cocoon package space).
>
> So, the scheduler I've proposed is already done. I just have to
> repackage it and add some more javadocs etc. It's about to be ready to
> be committed tomorrow.
>
> If there are still objection I hold on the commits until we reached
> consensus.
I have two more questions:
* what do we need a scheduler for in Cocoon in the first place?
* would your scheduler be able to handle the ContinuationsManager
cleanup task? The specific requirement I'm thinking of is that it
shouldn't be launched concurrently, so if the previous cleanup is still
running it shouldn't be launched a second time.
Other than that, I'll leave it up to your good judgement on what path to
follow, I don't have any experience with any schedulers anyway...
--
Bruno Dumon http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
bruno@outerthought.org bruno@apache.org
RE: CommandManager issues [was Re: Releasing 2.1.1?]
Posted by Giacomo Pati <gi...@apache.org>.
On Mon, 1 Sep 2003, Bruno Dumon wrote:
> On Mon, 2003-09-01 at 11:37, Giacomo Pati wrote:
> > On Mon, 1 Sep 2003, Reinhard Poetz wrote:
> >
> > >
> > >
> > > On Behalf Of Giacomo Pati
> > >
> > > > On Mon, 1 Sep 2003, Andreas Hochsteger wrote:
> > > >
> > > > > Hi!
> > > > >
> > > > > Just in case you didn't know:
> > > > > Did you have a look at the Quartz Scheduler?
> > > > > http://www.part.net/quartz.html
> > > > > http://www.part.net/quartz_features.html
> > > > > Perhaps it already does what you need.
> > > > > It's licensed under a BSD and Apache-Style license.
> > > >
> > > > I've seen it some time ago but thought it is quite too much
> > > > for a simple cron mechanism we are discussing here.
> > > >
> > > > Any other thoughts?
> > >
> > > Do you think it is difficult to use/to integrate? From the features list
> > > it is exactly what we need, isn't it?
> >
> > IMHO, from the feature list it is way too much we need, isn't it?
>
> I think many of it are optional features, and those extra features might
> come in handy some day. If it does everything we need and if it's solid,
> why not use it?
Hmm, the cocurrency util from Doug Lea does alot Quartz offers. So my
oppinion was not to add another dependency. Quartz (if I've read the
feature list correctly) doesn't offer Cron spec parsing, so we have to
do it anyway. And because I've alread done this for another project some
times ago I thought to but it into a Scheduler by it own (mean in the
org.apache.cocoon package space).
So, the scheduler I've proposed is already done. I just have to
repackage it and add some more javadocs etc. It's about to be ready to
be committed tomorrow.
If there are still objection I hold on the commits until we reached
consensus.
--
Giacomo Pati
Otego AG, Switzerland - http://www.otego.com
Orixo, the XML business alliance - http://www.orixo.com
Re: CommandManager issues [was Re: Releasing 2.1.1?]
Posted by Steven Noels <st...@outerthought.org>.
Nicola Ken Barozzi wrote:
> I'll have to start to play golf just to find a
> use for my tonsils)
Eeeck. Spare us the details! ;-)
</Steven>
--
Steven Noels http://outerthought.org/
Outerthought - Open Source Java & XML An Orixo Member
Read my weblog at http://blogs.cocoondev.org/stevenn/
stevenn at outerthought.org stevenn at apache.org
Re: CommandManager issues [was Re: Releasing 2.1.1?]
Posted by Nicola Ken Barozzi <ni...@apache.org>.
Carsten Ziegeler wrote, On 02/09/2003 15.21:
> Bruno Dumon wrote:
>
>>>Another idea: could you try my original changed jar available here:
>>>http://outerthought.net/~bruno/concurrent.jar
>>
>>Never mind, I can reproduce the problem now on marc's pc.
>
> Great, so I'm not insane! (I tried your version anyway, but without success)
OT: seems like me a few days ago, when I phoned my mom happily saying "I
have fever! :-D " because I felt groggy but nobody really took it
seriously before ;-)
(I'm quite sane now BTW, apart from a sore throat that is again getting
worse and the fact that I'll have to start to play golf just to find a
use for my tonsils)
--
Nicola Ken Barozzi nicolaken@apache.org
- verba volant, scripta manent -
(discussions get forgotten, just code remains)
---------------------------------------------------------------------
RE: CommandManager issues [was Re: Releasing 2.1.1?]
Posted by Bruno Dumon <br...@outerthought.org>.
On Tue, 2003-09-02 at 21:09, Giacomo Pati wrote:
> On Tue, 2 Sep 2003, Bruno Dumon wrote:
>
> > On Tue, 2003-09-02 at 15:21, Carsten Ziegeler wrote:
> > > Bruno Dumon wrote:
> > > > >
> > > > > Another idea: could you try my original changed jar available here:
> > > > > http://outerthought.net/~bruno/concurrent.jar
> > > >
> > > > Never mind, I can reproduce the problem now on marc's pc.
> > > >
> > > Great, so I'm not insane! (I tried your version anyway, but without success)
> >
> > Nope, in fact I'm very glad you tried it out because indeed there's
> > another problem in there. I don't have a quick solution for it though.
> > I've created (well, most of the credit goes to Marc) a testcase to
> > reproduce the problem and mailed it to Doug Lea.
>
> Hmm.. my Scheduler that uses Doug Leas kit dosn't have any problems at
> all.
Nope, you won't notice it easily, the only reason that it's so easily
reproducable in our current cocoon use is because on the one hand the
thread expires after 100ms, and on the other hand it is reused every 100
ms, so we very easily get in the situation where a thread is just being
freed when another one is being requested, and it's there where it goes
wrong. Changing parameters a very little bit will make this situation
much less likely to occur, but still this needs to be fixed.
--
Bruno Dumon http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
bruno@outerthought.org bruno@apache.org
Re: CommandManager issues [was Re: Releasing 2.1.1?]
Posted by Giacomo Pati <gi...@apache.org>.
On Tue, 2 Sep 2003, Berin Loritsch wrote:
> Giacomo Pati wrote:
>
> > On Tue, 2 Sep 2003, Bruno Dumon wrote:
> >
> >
> >>On Tue, 2003-09-02 at 15:21, Carsten Ziegeler wrote:
> >>
> >>>Bruno Dumon wrote:
> >>>
> >>>>>Another idea: could you try my original changed jar available here:
> >>>>>http://outerthought.net/~bruno/concurrent.jar
> >>>>
> >>>>Never mind, I can reproduce the problem now on marc's pc.
> >>>>
> >>>
> >>>Great, so I'm not insane! (I tried your version anyway, but without success)
> >>
> >>Nope, in fact I'm very glad you tried it out because indeed there's
> >>another problem in there. I don't have a quick solution for it though.
> >>I've created (well, most of the credit goes to Marc) a testcase to
> >>reproduce the problem and mailed it to Doug Lea.
> >
> >
> > Hmm.. my Scheduler that uses Doug Leas kit dosn't have any problems at
> > all.
>
> Are you using the PooledExecutor, or something else?
PoolExecutor.
--
Giacomo Pati
Otego AG, Switzerland - http://www.otego.com
Orixo, the XML business alliance - http://www.orixo.com
Re: CommandManager issues [was Re: Releasing 2.1.1?]
Posted by Berin Loritsch <bl...@apache.org>.
Giacomo Pati wrote:
> On Tue, 2 Sep 2003, Bruno Dumon wrote:
>
>
>>On Tue, 2003-09-02 at 15:21, Carsten Ziegeler wrote:
>>
>>>Bruno Dumon wrote:
>>>
>>>>>Another idea: could you try my original changed jar available here:
>>>>>http://outerthought.net/~bruno/concurrent.jar
>>>>
>>>>Never mind, I can reproduce the problem now on marc's pc.
>>>>
>>>
>>>Great, so I'm not insane! (I tried your version anyway, but without success)
>>
>>Nope, in fact I'm very glad you tried it out because indeed there's
>>another problem in there. I don't have a quick solution for it though.
>>I've created (well, most of the credit goes to Marc) a testcase to
>>reproduce the problem and mailed it to Doug Lea.
>
>
> Hmm.. my Scheduler that uses Doug Leas kit dosn't have any problems at
> all.
Are you using the PooledExecutor, or something else?
--
"They that give up essential liberty to obtain a little temporary safety
deserve neither liberty nor safety."
- Benjamin Franklin
RE: CommandManager issues [was Re: Releasing 2.1.1?]
Posted by Giacomo Pati <gi...@apache.org>.
On Tue, 2 Sep 2003, Bruno Dumon wrote:
> On Tue, 2003-09-02 at 15:21, Carsten Ziegeler wrote:
> > Bruno Dumon wrote:
> > > >
> > > > Another idea: could you try my original changed jar available here:
> > > > http://outerthought.net/~bruno/concurrent.jar
> > >
> > > Never mind, I can reproduce the problem now on marc's pc.
> > >
> > Great, so I'm not insane! (I tried your version anyway, but without success)
>
> Nope, in fact I'm very glad you tried it out because indeed there's
> another problem in there. I don't have a quick solution for it though.
> I've created (well, most of the credit goes to Marc) a testcase to
> reproduce the problem and mailed it to Doug Lea.
Hmm.. my Scheduler that uses Doug Leas kit dosn't have any problems at
all.
--
Giacomo Pati
Otego AG, Switzerland - http://www.otego.com
Orixo, the XML business alliance - http://www.orixo.com
RE: CommandManager issues [was Re: Releasing 2.1.1?]
Posted by Bruno Dumon <br...@outerthought.org>.
On Tue, 2003-09-02 at 15:21, Carsten Ziegeler wrote:
> Bruno Dumon wrote:
> > >
> > > Another idea: could you try my original changed jar available here:
> > > http://outerthought.net/~bruno/concurrent.jar
> >
> > Never mind, I can reproduce the problem now on marc's pc.
> >
> Great, so I'm not insane! (I tried your version anyway, but without success)
Nope, in fact I'm very glad you tried it out because indeed there's
another problem in there. I don't have a quick solution for it though.
I've created (well, most of the credit goes to Marc) a testcase to
reproduce the problem and mailed it to Doug Lea.
--
Bruno Dumon http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
bruno@outerthought.org bruno@apache.org
RE: CommandManager issues [was Re: Releasing 2.1.1?]
Posted by Carsten Ziegeler <cz...@s-und-n.de>.
Bruno Dumon wrote:
> >
> > Another idea: could you try my original changed jar available here:
> > http://outerthought.net/~bruno/concurrent.jar
>
> Never mind, I can reproduce the problem now on marc's pc.
>
Great, so I'm not insane! (I tried your version anyway, but without success)
Carsten
RE: CommandManager issues [was Re: Releasing 2.1.1?]
Posted by Bruno Dumon <br...@outerthought.org>.
On Tue, 2003-09-02 at 14:42, Bruno Dumon wrote:
> On Tue, 2003-09-02 at 12:48, Carsten Ziegeler wrote:
> > Bruno Dumon wrote:
> > >
> > > <SNIP>
> > > Looks ok, I changed the parameters in the cocoon.xconf though, but
> > > that's the same.
> > >
> > > Just tried it over here on a Windows box with java 1.4.2 and it also
> > > works. With "working" I mean I added a System.out.println to the
> > > ContinuationsInterrupt.execute() method and see it printed every 2
> > > seconds.
> > Yepp, I did the same and I have w2k, jdk 1.4.2 as well. Hmm strange.
> >
> > >
> > > > And then the execute() method is sometimes invoked once (before jetty is
> > > > up completly) and sometimes not at all.
> > >
> > > Sounds like the "old" bug, but I don't know what's causing it now (and I
> > > can't reproduce it over here).
> > >
> > Hmm, I did a clean checkout, changed the ContinuationManager as explained
> > and then a simple build and it's not working. I also checked the classpath
> > and it's a clean JDK 1.4.2 classpath.
> >
> > Just checking, but are you sure that your version is checked in? The jar is
> > new, but is the contents? (Forgive me the question, but we must have a
> > difference somewhere).
>
> No problem, but I'm rather sure.
>
> Another idea: could you try my original changed jar available here:
> http://outerthought.net/~bruno/concurrent.jar
Never mind, I can reproduce the problem now on marc's pc.
--
Bruno Dumon http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
bruno@outerthought.org bruno@apache.org
RE: CommandManager issues [was Re: Releasing 2.1.1?]
Posted by Bruno Dumon <br...@outerthought.org>.
On Tue, 2003-09-02 at 12:48, Carsten Ziegeler wrote:
> Bruno Dumon wrote:
> >
> > <SNIP>
> > Looks ok, I changed the parameters in the cocoon.xconf though, but
> > that's the same.
> >
> > Just tried it over here on a Windows box with java 1.4.2 and it also
> > works. With "working" I mean I added a System.out.println to the
> > ContinuationsInterrupt.execute() method and see it printed every 2
> > seconds.
> Yepp, I did the same and I have w2k, jdk 1.4.2 as well. Hmm strange.
>
> >
> > > And then the execute() method is sometimes invoked once (before jetty is
> > > up completly) and sometimes not at all.
> >
> > Sounds like the "old" bug, but I don't know what's causing it now (and I
> > can't reproduce it over here).
> >
> Hmm, I did a clean checkout, changed the ContinuationManager as explained
> and then a simple build and it's not working. I also checked the classpath
> and it's a clean JDK 1.4.2 classpath.
>
> Just checking, but are you sure that your version is checked in? The jar is
> new, but is the contents? (Forgive me the question, but we must have a
> difference somewhere).
No problem, but I'm rather sure.
Another idea: could you try my original changed jar available here:
http://outerthought.net/~bruno/concurrent.jar
--
Bruno Dumon http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
bruno@outerthought.org bruno@apache.org
RE: CommandManager issues [was Re: Releasing 2.1.1?]
Posted by Carsten Ziegeler <cz...@s-und-n.de>.
Bruno Dumon wrote:
>
> <SNIP>
> Looks ok, I changed the parameters in the cocoon.xconf though, but
> that's the same.
>
> Just tried it over here on a Windows box with java 1.4.2 and it also
> works. With "working" I mean I added a System.out.println to the
> ContinuationsInterrupt.execute() method and see it printed every 2
> seconds.
Yepp, I did the same and I have w2k, jdk 1.4.2 as well. Hmm strange.
>
> > And then the execute() method is sometimes invoked once (before jetty is
> > up completly) and sometimes not at all.
>
> Sounds like the "old" bug, but I don't know what's causing it now (and I
> can't reproduce it over here).
>
Hmm, I did a clean checkout, changed the ContinuationManager as explained
and then a simple build and it's not working. I also checked the classpath
and it's a clean JDK 1.4.2 classpath.
Just checking, but are you sure that your version is checked in? The jar is
new, but is the contents? (Forgive me the question, but we must have a
difference somewhere).
What about others? Is it working for you? Or not?
Carsten
RE: CommandManager issues [was Re: Releasing 2.1.1?]
Posted by Bruno Dumon <br...@outerthought.org>.
On Tue, 2003-09-02 at 10:10, Carsten Ziegeler wrote:
> Bruno Dumon wrote:
> >
> > I just verified and it works here (both jdk 1.4 and 1.3), so I'm looking
> > for alternative explanations: did you remove the old util.concurrent jar
> > from your WEB-INF/lib ?
> >
> Yes. Hmm, strange - just to make sure that I did nothing wrong when testing,
> I changed the following two methods in the interrupt:
>
> public long getRepeatInterval() {
> return 2000;
> }
>
> /**
> * Get the number of millis to wait for the first invocation
> */
> public long getDelayInterval() {
> return 0;
> }
>
Looks ok, I changed the parameters in the cocoon.xconf though, but
that's the same.
Just tried it over here on a Windows box with java 1.4.2 and it also
works. With "working" I mean I added a System.out.println to the
ContinuationsInterrupt.execute() method and see it printed every 2
seconds.
> And then the execute() method is sometimes invoked once (before jetty is
> up completly) and sometimes not at all.
Sounds like the "old" bug, but I don't know what's causing it now (and I
can't reproduce it over here).
--
Bruno Dumon http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
bruno@outerthought.org bruno@apache.org
RE: CommandManager issues [was Re: Releasing 2.1.1?]
Posted by Carsten Ziegeler <cz...@s-und-n.de>.
Bruno Dumon wrote:
>
> I just verified and it works here (both jdk 1.4 and 1.3), so I'm looking
> for alternative explanations: did you remove the old util.concurrent jar
> from your WEB-INF/lib ?
>
Yes. Hmm, strange - just to make sure that I did nothing wrong when testing,
I changed the following two methods in the interrupt:
public long getRepeatInterval() {
return 2000;
}
/**
* Get the number of millis to wait for the first invocation
*/
public long getDelayInterval() {
return 0;
}
And then the execute() method is sometimes invoked once (before jetty is
up completly) and sometimes not at all.
Carsten
RE: CommandManager issues [was Re: Releasing 2.1.1?]
Posted by Bruno Dumon <br...@outerthought.org>.
On Tue, 2003-09-02 at 09:16, Carsten Ziegeler wrote:
> Bruno Dumon wrote:
> >
> > On Tue, 2003-09-02 at 09:01, Carsten Ziegeler wrote:
> > > Hi,
> > >
> > > I just tested the last changes and it seems that the
> > continuation manager
> > > is still not working correctly.
> > >
> > > It seems that the ContinuationInterrupt is still not executed as soon
> > > as jetty is listening. Can someone confirm this?
> >
> > Did you change the default offset in the cocoon.xconf? By default, it
> > waits 180000 ms before the first execution.
> >
> Yes, I changed it to 0, and the interval to 2 secs (2000 ms). The interrupt
> is fired immediately until jetty is up and running then the execution stops.
>
I just verified and it works here (both jdk 1.4 and 1.3), so I'm looking
for alternative explanations: did you remove the old util.concurrent jar
from your WEB-INF/lib ?
--
Bruno Dumon http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
bruno@outerthought.org bruno@apache.org
RE: CommandManager issues [was Re: Releasing 2.1.1?]
Posted by Carsten Ziegeler <cz...@s-und-n.de>.
Bruno Dumon wrote:
>
> On Tue, 2003-09-02 at 09:01, Carsten Ziegeler wrote:
> > Hi,
> >
> > I just tested the last changes and it seems that the
> continuation manager
> > is still not working correctly.
> >
> > It seems that the ContinuationInterrupt is still not executed as soon
> > as jetty is listening. Can someone confirm this?
>
> Did you change the default offset in the cocoon.xconf? By default, it
> waits 180000 ms before the first execution.
>
Yes, I changed it to 0, and the interval to 2 secs (2000 ms). The interrupt
is fired immediately until jetty is up and running then the execution stops.
Carsten
RE: CommandManager issues [was Re: Releasing 2.1.1?]
Posted by Bruno Dumon <br...@outerthought.org>.
On Tue, 2003-09-02 at 09:01, Carsten Ziegeler wrote:
> Hi,
>
> I just tested the last changes and it seems that the continuation manager
> is still not working correctly.
>
> It seems that the ContinuationInterrupt is still not executed as soon
> as jetty is listening. Can someone confirm this?
Did you change the default offset in the cocoon.xconf? By default, it
waits 180000 ms before the first execution.
--
Bruno Dumon http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
bruno@outerthought.org bruno@apache.org
RE: CommandManager issues [was Re: Releasing 2.1.1?]
Posted by Carsten Ziegeler <cz...@s-und-n.de>.
Hi,
I just tested the last changes and it seems that the continuation manager
is still not working correctly.
It seems that the ContinuationInterrupt is still not executed as soon
as jetty is listening. Can someone confirm this?
Carsten
RE: CommandManager issues [was Re: Releasing 2.1.1?]
Posted by Giacomo Pati <gi...@apache.org>.
On Mon, 1 Sep 2003, Reinhard Poetz wrote:
>
> From: Bruno Dumon
>
> >
> > On Mon, 2003-09-01 at 11:37, Giacomo Pati wrote:
> > > On Mon, 1 Sep 2003, Reinhard Poetz wrote:
> > >
> > > >
> > > >
> > > > On Behalf Of Giacomo Pati
> > > >
> > > > > On Mon, 1 Sep 2003, Andreas Hochsteger wrote:
> > > > >
> > > > > > Hi!
> > > > > >
> > > > > > Just in case you didn't know:
> > > > > > Did you have a look at the Quartz Scheduler?
> > > > > > http://www.part.net/quartz.html
> > > > > > http://www.part.net/quartz_features.html
> > > > > > Perhaps it already does what you need.
> > > > > > It's licensed under a BSD and Apache-Style license.
> > > > >
> > > > > I've seen it some time ago but thought it is quite too
> > much for a
> > > > > simple cron mechanism we are discussing here.
> > > > >
> > > > > Any other thoughts?
> > > >
> > > > Do you think it is difficult to use/to integrate? From
> > the features
> > > > list it is exactly what we need, isn't it?
> > >
> > > IMHO, from the feature list it is way too much we need, isn't it?
> >
> > I think many of it are optional features, and those extra
> > features might come in handy some day. If it does everything
> > we need and if it's solid, why not use it?
>
> I think Giacomo is right that we won't need all those features within
> the Cocoon project but I think our users will need the most in their
> projects.
No sure here. The users I know best are happy with full Cron like
functionality.
> If Quartz does everything we want I'm +1 for adding it to
> Cocoon. So we would also avoid developing and maintainging our own
> scheduler solution because what I understood the Avalon solutions don't
> fit all our needs, do they?
As I've written in response to Brunos mail, Quartz doesn't offer Cron
spec parsing so we have to do that in the cocoon space anyway. The
concurrency utils (we already have a dependency of) does all we need to
trigger execution (as Quartz does) so why adding another dependency.
--
Giacomo Pati
Otego AG, Switzerland - http://www.otego.com
Orixo, the XML business alliance - http://www.orixo.com
RE: CommandManager issues [was Re: Releasing 2.1.1?]
Posted by Reinhard Poetz <re...@apache.org>.
From: Bruno Dumon
>
> On Mon, 2003-09-01 at 11:37, Giacomo Pati wrote:
> > On Mon, 1 Sep 2003, Reinhard Poetz wrote:
> >
> > >
> > >
> > > On Behalf Of Giacomo Pati
> > >
> > > > On Mon, 1 Sep 2003, Andreas Hochsteger wrote:
> > > >
> > > > > Hi!
> > > > >
> > > > > Just in case you didn't know:
> > > > > Did you have a look at the Quartz Scheduler?
> > > > > http://www.part.net/quartz.html
> > > > > http://www.part.net/quartz_features.html
> > > > > Perhaps it already does what you need.
> > > > > It's licensed under a BSD and Apache-Style license.
> > > >
> > > > I've seen it some time ago but thought it is quite too
> much for a
> > > > simple cron mechanism we are discussing here.
> > > >
> > > > Any other thoughts?
> > >
> > > Do you think it is difficult to use/to integrate? From
> the features
> > > list it is exactly what we need, isn't it?
> >
> > IMHO, from the feature list it is way too much we need, isn't it?
>
> I think many of it are optional features, and those extra
> features might come in handy some day. If it does everything
> we need and if it's solid, why not use it?
I think Giacomo is right that we won't need all those features within
the Cocoon project but I think our users will need the most in their
projects. If Quartz does everything we want I'm +1 for adding it to
Cocoon. So we would also avoid developing and maintainging our own
scheduler solution because what I understood the Avalon solutions don't
fit all our needs, do they?
Cheers,
Reinhard
RE: CommandManager issues [was Re: Releasing 2.1.1?]
Posted by Bruno Dumon <br...@outerthought.org>.
On Mon, 2003-09-01 at 11:37, Giacomo Pati wrote:
> On Mon, 1 Sep 2003, Reinhard Poetz wrote:
>
> >
> >
> > On Behalf Of Giacomo Pati
> >
> > > On Mon, 1 Sep 2003, Andreas Hochsteger wrote:
> > >
> > > > Hi!
> > > >
> > > > Just in case you didn't know:
> > > > Did you have a look at the Quartz Scheduler?
> > > > http://www.part.net/quartz.html
> > > > http://www.part.net/quartz_features.html
> > > > Perhaps it already does what you need.
> > > > It's licensed under a BSD and Apache-Style license.
> > >
> > > I've seen it some time ago but thought it is quite too much
> > > for a simple cron mechanism we are discussing here.
> > >
> > > Any other thoughts?
> >
> > Do you think it is difficult to use/to integrate? From the features list
> > it is exactly what we need, isn't it?
>
> IMHO, from the feature list it is way too much we need, isn't it?
I think many of it are optional features, and those extra features might
come in handy some day. If it does everything we need and if it's solid,
why not use it?
--
Bruno Dumon http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
bruno@outerthought.org bruno@apache.org
RE: CommandManager issues [was Re: Releasing 2.1.1?]
Posted by Giacomo Pati <gi...@apache.org>.
On Mon, 1 Sep 2003, Reinhard Poetz wrote:
>
>
> On Behalf Of Giacomo Pati
>
> > On Mon, 1 Sep 2003, Andreas Hochsteger wrote:
> >
> > > Hi!
> > >
> > > Just in case you didn't know:
> > > Did you have a look at the Quartz Scheduler?
> > > http://www.part.net/quartz.html
> > > http://www.part.net/quartz_features.html
> > > Perhaps it already does what you need.
> > > It's licensed under a BSD and Apache-Style license.
> >
> > I've seen it some time ago but thought it is quite too much
> > for a simple cron mechanism we are discussing here.
> >
> > Any other thoughts?
>
> Do you think it is difficult to use/to integrate? From the features list
> it is exactly what we need, isn't it?
IMHO, from the feature list it is way too much we need, isn't it?
--
Giacomo Pati
Otego AG, Switzerland - http://www.otego.com
Orixo, the XML business alliance - http://www.orixo.com
RE: CommandManager issues [was Re: Releasing 2.1.1?]
Posted by Reinhard Poetz <re...@apache.org>.
On Behalf Of Giacomo Pati
> On Mon, 1 Sep 2003, Andreas Hochsteger wrote:
>
> > Hi!
> >
> > Just in case you didn't know:
> > Did you have a look at the Quartz Scheduler?
> > http://www.part.net/quartz.html
> > http://www.part.net/quartz_features.html
> > Perhaps it already does what you need.
> > It's licensed under a BSD and Apache-Style license.
>
> I've seen it some time ago but thought it is quite too much
> for a simple cron mechanism we are discussing here.
>
> Any other thoughts?
Do you think it is difficult to use/to integrate? From the features list
it is exactly what we need, isn't it?
Cheers,
Reinhard
Re: CommandManager issues [was Re: Releasing 2.1.1?]
Posted by Giacomo Pati <gi...@apache.org>.
On Mon, 1 Sep 2003, Andreas Hochsteger wrote:
> Hi!
>
> Just in case you didn't know:
> Did you have a look at the Quartz Scheduler?
> http://www.part.net/quartz.html
> http://www.part.net/quartz_features.html
> Perhaps it already does what you need.
> It's licensed under a BSD and Apache-Style license.
I've seen it some time ago but thought it is quite too much for a simple
cron mechanism we are discussing here.
Any other thoughts?
>
> Here's another one:
> http://jcrontab.sourceforge.net/
It's (L)GPL
>
> I found the links on this page:
> http://wiki.cocoondev.org/Wiki.jsp?page=WyonaScheduler
>
> Bye,
> Andreas
>
> Giacomo Pati wrote:
> > On Sun, 31 Aug 2003, Bruno Dumon wrote:
> >
> >
> >>On Sun, 2003-08-31 at 20:38, Giacomo Pati wrote:
> >>
> >>>First, if you look at the Cornerstone Scheduler you'll see that the
> >>>ability to define repeated tasks are somehow limited. Business apps can
> >>>easily request administration tasks to be run twice a day on work days.
> >>>To define this with the Cornerstone Scheduler you'll need to add 10
> >>>'cron' entries to it. This is why I'd like to extend it using the unix
> >>>cron direction to define ranges and list of timing aspects. But then
> >>>you're faced with the problem of defining sleep time for efficient use
> >>>(which you need to be able to cooperate in the Cornerstone Scheduler
> >>>machinery).
> >>>
> >>>The unix cron daemon runs every minute to check if there are any jobs to
> >>>run. It checks initially creating bitsets for the minute, hour, day,
> >>>month, and weekday definition for each task. This makes it easy to
> >>>check whether a task has to be launched. I still haven't found an
> >>>algorithm (and I think there isn't an easy one available) to determine
> >>>the sleep time until the next task is due.
> >>
> >>Ah, didn't think that far.
> >>
> >>
> >>> Thus, a check every minute
> >>>isn't much but still 1440 times a day.
> >>
> >>But a lot less then the 864000 times a day in case of a check every 100
> >>ms :-)
> >
> >
> > Sure.
> >
> >
> >>>The other thing to respect if you'd like to go as efficent as possible
> >>>is the determination of Threads you'll need to run each cron task at the
> >>>time specified. But this needs knowledge about how much elapsed time a
> >>>task need to run to decide if you need one or two thread to complete to
> >>>task defined neat in time to each other. If you have an algorithm for
> >>>this you'll be able to define the maximum numbers of Thread you'll need.
> >>>Otherwise you allocate a separate Thread per defined task.
> >>>
> >>>The consequences are that probably the easiest solution to a (more or
> >>>less) complete Cron like Scheduler is an own heart beat of one minute to
> >>>check for task to launch and a pool of Threads as big as you have task
> >>>to process. As it seems Doug Leas concurrency tools could be configured
> >>>to be as resource sparing as possible (have a look at
> >>>http://gee.cs.oswego.edu/dl/classes/EDU/oswego/cs/dl/util/concurrent/PooledExecutor.html)
> >>
> >>Yep, I think that will be fine too.
> >
> >
> > Ok, so I'll gona build up a Scheduler based on its own heart beat (own
> > Thread) with Crond expressions for timing specifications that uses a
> > PooledExecutor for the Triggers in the size of the numbers of Task
> > defined in the configuration but with lazy construction of Thread
> > objects. This will not need any additional jars and the ones introduced
> > by the Cornerstone Sccheduler can be eliminated again. Is everybody
> > happy with that?
> >
> > --
> > Giacomo Pati
> > Otego AG, Switzerland - http://www.otego.com
> > Orixo, the XML business alliance - http://www.orixo.com
> >
> >
>
>
>
--
Giacomo Pati
Otego AG, Switzerland - http://www.otego.com
Orixo, the XML business alliance - http://www.orixo.com