You are viewing a plain text version of this content. The canonical link for it is here.
Posted to phoenix-dev@avalon.apache.org by Andrei Ivanov <my...@surfeu.fi> on 2002/07/09 11:37:57 UTC

ResourceLimitingThreadPool support in cornerstone?

Hi,
there is the org.apache.avalon.cornerstone.blocks.threads.ThreadManager
which is used for configuration of
org.apache.avalon.excalibur.thread.impl.DefaultThreadPool in Phoenix. But
there is no "ResourceLimitingThreadManager" implemented for cornetstone. Is
it dropped for a reason? From my point of view Phoenix (plus cornerstone) is
first of all server application oriented container so that ThreadManager
which uses
org.apache.avalon.excalibur.thread.impl.ResourceLimitingThreadPool must be
there.

Andrei


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Re: ResourceLimitingThreadPool support in cornerstone?

Posted by Peter Donald <pe...@apache.org>.
On Wed, 10 Jul 2002 21:03, Peter Donald wrote:
> > The problem is that when
> > number of threads reached its maximum (so that no new connection handlers
> > are created) I can not stop Phoenix without following exception (see PS).

Can you tell me if this still occurs with the latest CVS?

-- 
Cheers,

Peter Donald
--------------------------------------------
 Beer is proof that God loves us and wants 
 us to be happy. -- Benjamin Franklin
-------------------------------------------- 


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Re: Re: ResourceLimitingThreadPool support in cornerstone?

Posted by Andrei Ivanov <my...@surfeu.fi>.
Hi,

>> Also, I think org.apache.avalon.cornerstone.blocks.connection.Connection
>> class has to be modified in case of ResourceLimitingThreadManager...

>In what way?

Simply: creating of connection handler has to be moved to be inside internal
ConnectionRunner class. Why? If using resource limiting pool and number of
threads is exceeded it shouldn't create handler at all. Now it creates but
doesn't call handle connection which doesn't make any sense from my point of
view.

Andrei


----- Original Message -----
From: "Peter Donald" <pe...@apache.org>
To: "Avalon-Phoenix Developers List" <av...@jakarta.apache.org>
Sent: Wednesday, July 10, 2002 2:03 PM
Subject: Re: Re: ResourceLimitingThreadPool support in cornerstone?


On Tue, 9 Jul 2002 22:06, Andrei Ivanov wrote:
> This is what I am working on now. So far I came across with simple
problem.
> I have phoenix based server application: usual connection handler etc.
When
> I was using DefaultThreadManager (DefaultThreadPool) I had sometime
> situations when server was just creating new threads (hundreds of them).
> After looking deeply into this problem I found mentioned lack of support
of
> ResourceLimitingThreadPool in cornerstone. So I implemented new
> ResourceLimitingThreadManager and now testing it.

kool!

> The problem is that when
> number of threads reached its maximum (so that no new connection handlers
> are created) I can not stop Phoenix without following exception (see PS).

hmm. I will look into that. Could you lodge a bug on Bugzilla?

> Also, I think org.apache.avalon.cornerstone.blocks.connection.Connection
> class has to be modified in case of ResourceLimitingThreadManager...

In what way?

--
Cheers,

Peter Donald
-------------------------------------------------------------
|  Egoism is the drug that soothes the pain of stupidity.   |
-------------------------------------------------------------


--
To unsubscribe, e-mail:   <mailto:avalon-phoenix-dev-unsubscribe@jakarta.apa
che.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Re: ResourceLimitingThreadPool support in cornerstone?

Posted by Peter Donald <pe...@apache.org>.
On Tue, 9 Jul 2002 22:06, Andrei Ivanov wrote:
> This is what I am working on now. So far I came across with simple problem.
> I have phoenix based server application: usual connection handler etc. When
> I was using DefaultThreadManager (DefaultThreadPool) I had sometime
> situations when server was just creating new threads (hundreds of them).
> After looking deeply into this problem I found mentioned lack of support of
> ResourceLimitingThreadPool in cornerstone. So I implemented new
> ResourceLimitingThreadManager and now testing it. 

kool!

> The problem is that when
> number of threads reached its maximum (so that no new connection handlers
> are created) I can not stop Phoenix without following exception (see PS).

hmm. I will look into that. Could you lodge a bug on Bugzilla?

> Also, I think org.apache.avalon.cornerstone.blocks.connection.Connection
> class has to be modified in case of ResourceLimitingThreadManager...

In what way?

-- 
Cheers,

Peter Donald
-------------------------------------------------------------
|  Egoism is the drug that soothes the pain of stupidity.   |
------------------------------------------------------------- 


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Re: ResourceLimitingThreadPool support in cornerstone?

Posted by Andrei Ivanov <my...@surfeu.fi>.
This is what I am working on now. So far I came across with simple problem.
I have phoenix based server application: usual connection handler etc. When
I was using DefaultThreadManager (DefaultThreadPool) I had sometime
situations when server was just creating new threads (hundreds of them).
After looking deeply into this problem I found mentioned lack of support of
ResourceLimitingThreadPool in cornerstone. So I implemented new
ResourceLimitingThreadManager and now testing it. The problem is that when
number of threads reached its maximum (so that no new connection handlers
are created) I can not stop Phoenix without following exception (see PS).
Also, I think org.apache.avalon.cornerstone.blocks.connection.Connection
class has to be modified in case of ResourceLimitingThreadManager...

Andrei
PS
JVM exiting abnormally. Shutting down Phoenix.
java.lang.IllegalArgumentException: Specified ThreadContext is already bound
to a thread
        at
org.apache.excalibur.threadcontext.ThreadContext.setThreadContext(ThreadCont
ext.java:104)
        at
org.apache.avalon.phoenix.components.application.DefaultApplication.runPhase
(DefaultApplication.java:350)
        at
org.apache.avalon.phoenix.components.application.DefaultApplication.stop(Def
aultApplication.java:181)
        at
org.apache.avalon.framework.container.ContainerUtil.stop(ContainerUtil.java:
267)
        at
org.apache.avalon.framework.container.ContainerUtil.shutdown(ContainerUtil.j
ava:57)
        at
org.apache.avalon.phoenix.components.kernel.DefaultKernel.shutdown(DefaultKe
rnel.java:177)
        at
org.apache.avalon.phoenix.components.kernel.DefaultKernel.removeApplication(
DefaultKernel.java:273)
        at
org.apache.avalon.phoenix.components.deployer.DefaultDeployer.undeploy(Defau
ltDeployer.java:202)
        at
org.apache.avalon.phoenix.components.deployer.DefaultDeployer.dispose(Defaul
tDeployer.java:167)
        at
org.apache.avalon.framework.container.ContainerUtil.dispose(ContainerUtil.ja
va:281)
        at
org.apache.avalon.framework.container.ContainerUtil.shutdown(ContainerUtil.j
ava:58)
        at
org.apache.avalon.phoenix.components.embeddor.DefaultEmbeddor.shutdownCompon
ents(DefaultEmbeddor.java:547)
        at
org.apache.avalon.phoenix.components.embeddor.DefaultEmbeddor.dispose(Defaul
tEmbeddor.java:293)
        at
org.apache.avalon.framework.container.ContainerUtil.dispose(ContainerUtil.ja
va:281)
        at
org.apache.avalon.framework.container.ContainerUtil.shutdown(ContainerUtil.j
ava:58)
        at
org.apache.avalon.phoenix.frontends.CLIMain.shutdown(CLIMain.java:285)
        at
org.apache.avalon.phoenix.frontends.CLIMain.forceShutdown(CLIMain.java:254)
        at
org.apache.avalon.phoenix.frontends.ShutdownHook.run(CLIMain.java:345)



----- Original Message -----
From: "Peter Donald" <pe...@apache.org>
To: "Avalon-Phoenix Developers List" <av...@jakarta.apache.org>
Sent: Tuesday, July 09, 2002 2:51 PM
Subject: Re: ResourceLimitingThreadPool support in cornerstone?


On Tue, 9 Jul 2002 19:37, Andrei Ivanov wrote:
> there is the org.apache.avalon.cornerstone.blocks.threads.ThreadManager
> which is used for configuration of
> org.apache.avalon.excalibur.thread.impl.DefaultThreadPool in Phoenix. But
> there is no "ResourceLimitingThreadManager" implemented for cornetstone.
Is
> it dropped for a reason? From my point of view Phoenix (plus cornerstone)
> is first of all server application oriented container so that
ThreadManager
> which uses
> org.apache.avalon.excalibur.thread.impl.ResourceLimitingThreadPool must be
> there.

You are right. It is something that is missing. It would be nice to extend
DefaultThreadManager so that it could define "thread groups" (aka pools) as
resource limiting. Wanna send a patch ? ;)


--
Cheers,

Peter Donald
----------------------------------------
"Liberty means responsibility. That is
      why most men dread it." - Locke
----------------------------------------


--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: ResourceLimitingThreadPool support in cornerstone?

Posted by Peter Donald <pe...@apache.org>.
On Tue, 9 Jul 2002 19:37, Andrei Ivanov wrote:
> there is the org.apache.avalon.cornerstone.blocks.threads.ThreadManager
> which is used for configuration of
> org.apache.avalon.excalibur.thread.impl.DefaultThreadPool in Phoenix. But
> there is no "ResourceLimitingThreadManager" implemented for cornetstone. Is
> it dropped for a reason? From my point of view Phoenix (plus cornerstone)
> is first of all server application oriented container so that ThreadManager
> which uses
> org.apache.avalon.excalibur.thread.impl.ResourceLimitingThreadPool must be
> there.

You are right. It is something that is missing. It would be nice to extend 
DefaultThreadManager so that it could define "thread groups" (aka pools) as 
resource limiting. Wanna send a patch ? ;)


-- 
Cheers,

Peter Donald
----------------------------------------
"Liberty means responsibility. That is 
      why most men dread it." - Locke
---------------------------------------- 


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>