You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Carsten Ziegeler <cz...@s-und-n.de> on 2003/08/28 08:12:59 UTC

Releasing 2.1.1?

Hi,

as several of you have already pointed out, a 2.1.1 release seems
to make sense. 

I can make a release next week, but I really would like to have the
scheduling (CommandManager) problem fixed in the release. Is anyone
working already on it? 

Thanks
Carsten 



Re: Shutdown bug (was: Re: Releasing 2.1.1?)

Posted by Antonio Gallardo <ag...@agsoftware.dnsalias.com>.
Jeff Turner dijo:
> On Fri, Aug 29, 2003 at 10:18:40PM +0200, Bruno Dumon wrote:
> ...
> [on bug http://nagoya.apache.org/bugzilla/show_bug.cgi?id=18131]
> ...
>> ok, 10 minutes later now, got an idea:
>>
>> if you add the following code before the closing bracket of the
>> PooledExecutor.workerDone(...) method, then it --seems to-- work:
>>
>>     if (!shutdown_) {
>>       if (poolSize_ < maximumPoolSize_) {
>>         Runnable r= null;
>>         try {
>>           r = getTask();
>>         } catch (InterruptedException e) {
>>           e.printStackTrace();
>>         }
>>         if (r != null)
>>           addThread(r);
>>       }
>>     }
>>
>> Could someone else also try this out? For your convenience, here's a
>> compiled jar with this change:
>> http://outerthought.net/~bruno/concurrent.jar
>>
>> just copy it over the util.concurrent-1.3.1.jar
>
> Great :)  Tomcat shutdown works fine on my system with this jar.  Thanks
> muchly.

Brilliant Bruno! Where you will commit this long awaited feature and close
the bug. ;)

Best Regards,

Antonio Gallardo
>
>
> --Jeff




Shutdown bug (was: Re: Releasing 2.1.1?)

Posted by Jeff Turner <je...@apache.org>.
On Fri, Aug 29, 2003 at 10:18:40PM +0200, Bruno Dumon wrote:
...
[on bug http://nagoya.apache.org/bugzilla/show_bug.cgi?id=18131]
...
> ok, 10 minutes later now, got an idea:
> 
> if you add the following code before the closing bracket of the
> PooledExecutor.workerDone(...) method, then it --seems to-- work:
> 
>     if (!shutdown_) {
>       if (poolSize_ < maximumPoolSize_) {
>         Runnable r= null;
>         try {
>           r = getTask();
>         } catch (InterruptedException e) {
>           e.printStackTrace();
>         }
>         if (r != null)
>           addThread(r);
>       }
>     }
> 
> Could someone else also try this out? For your convenience, here's a
> compiled jar with this change:
> http://outerthought.net/~bruno/concurrent.jar
> 
> just copy it over the util.concurrent-1.3.1.jar

Great :)  Tomcat shutdown works fine on my system with this jar.  Thanks
muchly.  


--Jeff

Re: Releasing 2.1.1?

Posted by Bruno Dumon <br...@outerthought.org>.
On Fri, 2003-08-29 at 19:55, Giacomo Pati wrote:
> On Fri, 29 Aug 2003, Bruno Dumon wrote:
> 
> > For me it works with Linux/Sun jdk 1.4.2, it doesn't work with 1.3.1.
> > For Carsten it doesn't work with Windows/jdk 1.4 either. I've done all
> > my testing with the Jetty which ships with Cocoon.
> >
> > I've added some println's here and there and it appears that, with
> > 1.3.1, the CommandManager starts working but stops as soon as Jetty
> > prints out the following lines:
> > Fri Aug 29 13:58:07 CEST 2003 Listening for connections ...
> > 13:58:07.575 EVENT  Started SocketListener on 0.0.0.0:8888
> 
> I have the above also in with sun jdk 1.4.2 on Linux.

It's probably a coincidence. If you supply a higher value for the
"sleep-time" parameter of the CommandManager, for example 1000 ms, it
will probably keep working for you too (with 1.3 also).

I think the problem lies somewhere in the PooledExecutor and/or
SynchronousChannel classes from the concurrent package.

If you take a look at the PooledExecutor class, there's a getTask method
that is called by worker threads (see the inner class Worker). Shortly
before jetty binds to port 8888 it probably does something cpu
intensive, causing the poll(sleep-time) call in the getTask method to
timeout, and the getTask() method to return null, which in itself causes
the worker thread to be released. More or less at the same time, the
PooledExecutor is asked to execute another runnable but it thinks no
threads are available anymore and "hands off" the runnable to the
SynchronousChannel. How it then needs to get out of that situation is
currently still a mystery for me... 


ok, 10 minutes later now, got an idea:

if you add the following code before the closing bracket of the
PooledExecutor.workerDone(...) method, then it --seems to-- work:

    if (!shutdown_) {
      if (poolSize_ < maximumPoolSize_) {
        Runnable r= null;
        try {
          r = getTask();
        } catch (InterruptedException e) {
          e.printStackTrace();
        }
        if (r != null)
          addThread(r);
      }
    }

Could someone else also try this out? For your convenience, here's a
compiled jar with this change:
http://outerthought.net/~bruno/concurrent.jar

just copy it over the util.concurrent-1.3.1.jar


> 
> > It seems that the thread that was executing the commands is somehow not
> > released (or whathever), so when the ThreadManager wants to execute the
> > next command it keeps waiting for a thread to be released (this waiting
> > happens in Doug Lea's Executor). If the "threads-per-processor"
> > parameter is augmented to "2", then it keeps working.
> 
> Have not tried using a second Thread.
> 
> >
> > According to Giacomo, the CommandManager works just fine in a
> > non-servlet environment.
> 
> Right.

-- 
Bruno Dumon                             http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
bruno@outerthought.org                          bruno@apache.org


Re: Releasing 2.1.1?

Posted by Giacomo Pati <gi...@apache.org>.
On Fri, 29 Aug 2003, Bruno Dumon wrote:

> For me it works with Linux/Sun jdk 1.4.2, it doesn't work with 1.3.1.
> For Carsten it doesn't work with Windows/jdk 1.4 either. I've done all
> my testing with the Jetty which ships with Cocoon.
>
> I've added some println's here and there and it appears that, with
> 1.3.1, the CommandManager starts working but stops as soon as Jetty
> prints out the following lines:
> Fri Aug 29 13:58:07 CEST 2003 Listening for connections ...
> 13:58:07.575 EVENT  Started SocketListener on 0.0.0.0:8888

I have the above also in with sun jdk 1.4.2 on Linux.

> It seems that the thread that was executing the commands is somehow not
> released (or whathever), so when the ThreadManager wants to execute the
> next command it keeps waiting for a thread to be released (this waiting
> happens in Doug Lea's Executor). If the "threads-per-processor"
> parameter is augmented to "2", then it keeps working.

Have not tried using a second Thread.

>
> According to Giacomo, the CommandManager works just fine in a
> non-servlet environment.

Right.

--
Giacomo Pati
Otego AG, Switzerland - http://www.otego.com
Orixo, the XML business alliance - http://www.orixo.com


Re: Releasing 2.1.1?

Posted by Bruno Dumon <br...@outerthought.org>.
On Fri, 2003-08-29 at 15:35, Berin Loritsch wrote:
> Bruno Dumon wrote:
> > On Thu, 2003-08-28 at 08:12, Carsten Ziegeler wrote:
> > 
> >>Hi,
> >>
> >>as several of you have already pointed out, a 2.1.1 release seems
> >>to make sense. 
> >>
> >>I can make a release next week, but I really would like to have the
> >>scheduling (CommandManager) problem fixed in the release. Is anyone
> >>working already on it? 
> > 
> > 
> > Not over here. If all else fails, we could disable the CommandManager
> > and let the ContinuationsManager start a thread of its own (like e.g.
> > the StoreJanitor does).
> > 
> 
> What version of CommandManager are you using?

The one shipping with Cocoon.

>   I am very interested
> in fixing it so that it works all the time.  Also, under what circumstances
> does it break?

Don't know exactly. Here's what I've found out till now:

For me it works with Linux/Sun jdk 1.4.2, it doesn't work with 1.3.1.
For Carsten it doesn't work with Windows/jdk 1.4 either. I've done all
my testing with the Jetty which ships with Cocoon. 

I've added some println's here and there and it appears that, with
1.3.1, the CommandManager starts working but stops as soon as Jetty
prints out the following lines:
Fri Aug 29 13:58:07 CEST 2003 Listening for connections ...
13:58:07.575 EVENT  Started SocketListener on 0.0.0.0:8888

It seems that the thread that was executing the commands is somehow not
released (or whathever), so when the ThreadManager wants to execute the
next command it keeps waiting for a thread to be released (this waiting
happens in Doug Lea's Executor). If the "threads-per-processor"
parameter is augmented to "2", then it keeps working.

According to Giacomo, the CommandManager works just fine in a
non-servlet environment.

-- 
Bruno Dumon                             http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
bruno@outerthought.org                          bruno@apache.org


Re: Releasing 2.1.1?

Posted by Giacomo Pati <gi...@apache.org>.
On Fri, 29 Aug 2003, Berin Loritsch wrote:

> Bruno Dumon wrote:
> > On Thu, 2003-08-28 at 08:12, Carsten Ziegeler wrote:
> >
> >>Hi,
> >>
> >>as several of you have already pointed out, a 2.1.1 release seems
> >>to make sense.
> >>
> >>I can make a release next week, but I really would like to have the
> >>scheduling (CommandManager) problem fixed in the release. Is anyone
> >>working already on it?
> >
> >
> > Not over here. If all else fails, we could disable the CommandManager
> > and let the ContinuationsManager start a thread of its own (like e.g.
> > the StoreJanitor does).
> >
>
> What version of CommandManager are you using?  I am very interested
> in fixing it so that it works all the time.  Also, under what circumstances
> does it break?

I'm using the latest (from CVS) put alot of gebugging into it to
see wher it goes. Unfortunately at some time in the startup of the
servlet container it stops working (I've put a test command right after
constructing the CommandManager in Cocoon.java).


--
Giacomo Pati
Otego AG, Switzerland - http://www.otego.com
Orixo, the XML business alliance - http://www.orixo.com


RE: Releasing 2.1.1?

Posted by Carsten Ziegeler <cz...@s-und-n.de>.
Have a look at this thread:

http://marc.theaimsgroup.com/?l=xml-cocoon-dev&m=106189194527050&w=2

and this bug

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=18131

Now, it seems that the CommandManager is not working in all environments.
In my it's not working but I don't have the shutdown problem and I 
guess it's vice versa.

We are using the released version 1.0.3, but I tested the latest CVS and I
guess Giacomo is also using the latest.

Carsten

Berin Loritsch [mailto:bloritsch@apache.org] wrote:
> 
> What version of CommandManager are you using?  I am very interested
> in fixing it so that it works all the time.  Also, under what 
> circumstances
> does it break?
> 
> 

Re: Releasing 2.1.1?

Posted by Berin Loritsch <bl...@apache.org>.
Bruno Dumon wrote:
> On Thu, 2003-08-28 at 08:12, Carsten Ziegeler wrote:
> 
>>Hi,
>>
>>as several of you have already pointed out, a 2.1.1 release seems
>>to make sense. 
>>
>>I can make a release next week, but I really would like to have the
>>scheduling (CommandManager) problem fixed in the release. Is anyone
>>working already on it? 
> 
> 
> Not over here. If all else fails, we could disable the CommandManager
> and let the ContinuationsManager start a thread of its own (like e.g.
> the StoreJanitor does).
> 

What version of CommandManager are you using?  I am very interested
in fixing it so that it works all the time.  Also, under what circumstances
does it break?


-- 

"They that give up essential liberty to obtain a little temporary safety
  deserve neither liberty nor safety."
                 - Benjamin Franklin


Re: Releasing 2.1.1?

Posted by Giacomo Pati <gi...@apache.org>.
On Fri, 29 Aug 2003, Bruno Dumon wrote:

> On Thu, 2003-08-28 at 08:12, Carsten Ziegeler wrote:
> > Hi,
> >
> > as several of you have already pointed out, a 2.1.1 release seems
> > to make sense.
> >
> > I can make a release next week, but I really would like to have the
> > scheduling (CommandManager) problem fixed in the release. Is anyone
> > working already on it?
>
> Not over here. If all else fails, we could disable the CommandManager
> and let the ContinuationsManager start a thread of its own (like e.g.
> the StoreJanitor does).

I'm still debugging that issues. So far I'm at the point where the Queue
stops working at the point (more or less) at the time jetty opens the
listening ports (8888).

Stay tuned.

--
Giacomo Pati
Otego AG, Switzerland - http://www.otego.com
Orixo, the XML business alliance - http://www.orixo.com


RE: Releasing 2.1.1?

Posted by Bruno Dumon <br...@outerthought.org>.
On Fri, 2003-08-29 at 14:20, Carsten Ziegeler wrote:
> Bruno Dumon wrote:
> > 
> > On Thu, 2003-08-28 at 08:12, Carsten Ziegeler wrote:
> > > Hi,
> > > 
> > > as several of you have already pointed out, a 2.1.1 release seems
> > > to make sense. 
> > > 
> > > I can make a release next week, but I really would like to have the
> > > scheduling (CommandManager) problem fixed in the release. Is anyone
> > > working already on it? 
> > 
> > Not over here. If all else fails, we could disable the CommandManager
> > and let the ContinuationsManager start a thread of its own (like e.g.
> > the StoreJanitor does).
> > 
> We could simply switch back to the cornerstone scheduler which works.

Fine with me too.

-- 
Bruno Dumon                             http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
bruno@outerthought.org                          bruno@apache.org


RE: Releasing 2.1.1?

Posted by Carsten Ziegeler <cz...@s-und-n.de>.
Bruno Dumon wrote:
> 
> On Thu, 2003-08-28 at 08:12, Carsten Ziegeler wrote:
> > Hi,
> > 
> > as several of you have already pointed out, a 2.1.1 release seems
> > to make sense. 
> > 
> > I can make a release next week, but I really would like to have the
> > scheduling (CommandManager) problem fixed in the release. Is anyone
> > working already on it? 
> 
> Not over here. If all else fails, we could disable the CommandManager
> and let the ContinuationsManager start a thread of its own (like e.g.
> the StoreJanitor does).
> 
We could simply switch back to the cornerstone scheduler which works.

Carsten

RE: Releasing 2.1.1?

Posted by Carsten Ziegeler <cz...@s-und-n.de>.
Bruno Dumon wrote:
> 
> On Thu, 2003-08-28 at 08:12, Carsten Ziegeler wrote:
> > Hi,
> > 
> > as several of you have already pointed out, a 2.1.1 release seems
> > to make sense. 
> > 
> > I can make a release next week, but I really would like to have the
> > scheduling (CommandManager) problem fixed in the release. Is anyone
> > working already on it? 
> 
> Not over here. If all else fails, we could disable the CommandManager
> and let the ContinuationsManager start a thread of its own (like e.g.
> the StoreJanitor does).
> 
We could simply switch back to the cornerstone scheduler which works.

Carsten

Re: Releasing 2.1.1?

Posted by Bruno Dumon <br...@outerthought.org>.
On Thu, 2003-08-28 at 08:12, Carsten Ziegeler wrote:
> Hi,
> 
> as several of you have already pointed out, a 2.1.1 release seems
> to make sense. 
> 
> I can make a release next week, but I really would like to have the
> scheduling (CommandManager) problem fixed in the release. Is anyone
> working already on it? 

Not over here. If all else fails, we could disable the CommandManager
and let the ContinuationsManager start a thread of its own (like e.g.
the StoreJanitor does).

-- 
Bruno Dumon                             http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
bruno@outerthought.org                          bruno@apache.org


Re: Releasing 2.1.1?

Posted by Giacomo Pati <gi...@apache.org>.
On Thu, 28 Aug 2003, Carsten Ziegeler wrote:

> Hi,
>
> as several of you have already pointed out, a 2.1.1 release seems
> to make sense.
>
> I can make a release next week, but I really would like to have the
> scheduling (CommandManager) problem fixed in the release. Is anyone
> working already on it?

I've just made a standalone main app with the CommandManager and,
confusing enought, it works correclty as expected.

So, it must be the environment Cocoon runs in that causes troubles
(Servlet?)

--
Giacomo Pati
Otego AG, Switzerland - http://www.otego.com
Orixo, the XML business alliance - http://www.orixo.com