You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Phil Steitz <ph...@gmail.com> on 2007/12/27 22:40:03 UTC
[pool] POOL-97 timer patch
I am not sure whether this is actually a bug, or worth reopening
POOL-97, but want to be safe rather than sorry before releasing 1.4.
I am getting JVM hangs with the current code when I fail to close the
pool. This did not happen with the 1.3 code. The (admittedly sloppy)
code in trunks-sandbox/performance/pool/..PoolSoak, PoolClientThread
creates a pool that can have an evictor configured (config is in
pool-config.xml, but neglects to close the pool on termination. With
pool 1.3, the JVM terminates normally, but with 1.4 it hangs with
thread dump that starts like this:
[java] Full thread dump Java HotSpot(TM) Client VM (1.5.0_12-b04
mixed mode, sharing):
[java] "DestroyJavaVM" prio=1 tid=0x08ead7e8 nid=0x2f7b waiting
on condition [0x00000000..0xbfd728c0]
[java] "Timer-0" prio=1 tid=0x08ea50c8 nid=0x2f88 in
Object.wait() [0xb1139000..0xb1139f30]
[java] at java.lang.Object.wait(Native Method)
[java] - waiting on <0x88eb8300> (a java.util.TaskQueue)
[java] at java.util.TimerThread.mainLoop(Timer.java:509)
[java] - locked <0x88eb8300> (a java.util.TaskQueue)
[java] at java.util.TimerThread.run(Timer.java:462)
Would appreciate any comments on this and suggestions for what, if
any, warning should go into the release notes. What is in changes.xml
now is what the notes are generated from.
Phil
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org
Re: [pool] POOL-97 timer patch
Posted by Phil Steitz <ph...@gmail.com>.
Thanks. I will apply this when I am back online. One thing I don't
understand is why the unit tests (which test eviction) do not hang.
Any ideas on that or tests we can add to pick this up?
On 12/29/07, Mark Thomas <ma...@apache.org> wrote:
> Mark Thomas wrote:
> > Phil Steitz wrote:
> >> Yes, I saw this with both the pool and dbcp tests when I set the
> >> timeBetweenEvictionRuns to a positive number
> >
> > Sorry. My bad. I was being stupid. I see this now with 1.5.0_13 and
> > 1.6.0_03. I'll see if I can figure out why.
>
> Found it. My new EvictionTimer class wasn't configuring the timer thread as
> a daemon thread unlike the code it replaced. The following patch fixes it.
>
> Mark
>
> Index: EvictionTimer.java
> ===================================================================
> --- EvictionTimer.java (revision 607305)
> +++ EvictionTimer.java (working copy)
> @@ -53,7 +53,7 @@
> */
> static synchronized void schedule(TimerTask task, long delay, long
> period) {
> if (null == _timer) {
> - _timer = new Timer();
> + _timer = new Timer(true);
> }
> _usageCount++;
> _timer.schedule(task, delay, period);
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org
Re: [pool] POOL-97 timer patch
Posted by Phil Steitz <ph...@gmail.com>.
Thanks. I will apply this when I am back online. One thing I don't
understand is why the unit tests (which test eviction) do not hang.
Any ideas on that or tests we can add to pick this up?
On 12/29/07, Mark Thomas <ma...@apache.org> wrote:
> Mark Thomas wrote:
> > Phil Steitz wrote:
> >> Yes, I saw this with both the pool and dbcp tests when I set the
> >> timeBetweenEvictionRuns to a positive number
> >
> > Sorry. My bad. I was being stupid. I see this now with 1.5.0_13 and
> > 1.6.0_03. I'll see if I can figure out why.
>
> Found it. My new EvictionTimer class wasn't configuring the timer thread as
> a daemon thread unlike the code it replaced. The following patch fixes it.
>
> Mark
>
> Index: EvictionTimer.java
> ===================================================================
> --- EvictionTimer.java (revision 607305)
> +++ EvictionTimer.java (working copy)
> @@ -53,7 +53,7 @@
> */
> static synchronized void schedule(TimerTask task, long delay, long
> period) {
> if (null == _timer) {
> - _timer = new Timer();
> + _timer = new Timer(true);
> }
> _usageCount++;
> _timer.schedule(task, delay, period);
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org
Re: [pool] POOL-97 timer patch
Posted by Mark Thomas <ma...@apache.org>.
Mark Thomas wrote:
> Phil Steitz wrote:
>> Yes, I saw this with both the pool and dbcp tests when I set the
>> timeBetweenEvictionRuns to a positive number
>
> Sorry. My bad. I was being stupid. I see this now with 1.5.0_13 and
> 1.6.0_03. I'll see if I can figure out why.
Found it. My new EvictionTimer class wasn't configuring the timer thread as
a daemon thread unlike the code it replaced. The following patch fixes it.
Mark
Index: EvictionTimer.java
===================================================================
--- EvictionTimer.java (revision 607305)
+++ EvictionTimer.java (working copy)
@@ -53,7 +53,7 @@
*/
static synchronized void schedule(TimerTask task, long delay, long
period) {
if (null == _timer) {
- _timer = new Timer();
+ _timer = new Timer(true);
}
_usageCount++;
_timer.schedule(task, delay, period);
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org
Re: [pool] POOL-97 timer patch
Posted by Mark Thomas <ma...@apache.org>.
Phil Steitz wrote:
> Yes, I saw this with both the pool and dbcp tests when I set the
> timeBetweenEvictionRuns to a positive number
Sorry. My bad. I was being stupid. I see this now with 1.5.0_13 and
1.6.0_03. I'll see if I can figure out why.
Mark
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org
Re: [pool] POOL-97 timer patch
Posted by Phil Steitz <ph...@gmail.com>.
Yes, I saw this with both the pool and dbcp tests when I set the
timeBetweenEvictionRuns to a positive number
On 12/28/07, Mark Thomas <ma...@apache.org> wrote:
> Phil Steitz wrote:
> > I am not sure whether this is actually a bug, or worth reopening
> > POOL-97, but want to be safe rather than sorry before releasing 1.4.
> >
> > I am getting JVM hangs with the current code when I fail to close the
> > pool. This did not happen with the 1.3 code. The (admittedly sloppy)
> > code in trunks-sandbox/performance/pool/..PoolSoak, PoolClientThread
> > creates a pool that can have an evictor configured (config is in
> > pool-config.xml, but neglects to close the pool on termination. With
> > pool 1.3, the JVM terminates normally, but with 1.4 it hangs with
> > thread dump that starts like this:
> >
> > [java] Full thread dump Java HotSpot(TM) Client VM (1.5.0_12-b04
> > mixed mode, sharing):
>
> Phil,
>
> I am not sure I am running the right test as I don't see this. Running
> org.apache.commons.performance.pool.PoolSoakTest with commons-pool from the
> 1.4 release branch the test ends normally. I see the same behaviour with
> 1.6.0_03 and 1.5.0_13 JDKs.
>
> Am I running the right test?
>
> Mark
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org
Re: [pool] POOL-97 timer patch
Posted by Mark Thomas <ma...@apache.org>.
Phil Steitz wrote:
> I am not sure whether this is actually a bug, or worth reopening
> POOL-97, but want to be safe rather than sorry before releasing 1.4.
>
> I am getting JVM hangs with the current code when I fail to close the
> pool. This did not happen with the 1.3 code. The (admittedly sloppy)
> code in trunks-sandbox/performance/pool/..PoolSoak, PoolClientThread
> creates a pool that can have an evictor configured (config is in
> pool-config.xml, but neglects to close the pool on termination. With
> pool 1.3, the JVM terminates normally, but with 1.4 it hangs with
> thread dump that starts like this:
>
> [java] Full thread dump Java HotSpot(TM) Client VM (1.5.0_12-b04
> mixed mode, sharing):
Phil,
I am not sure I am running the right test as I don't see this. Running
org.apache.commons.performance.pool.PoolSoakTest with commons-pool from the
1.4 release branch the test ends normally. I see the same behaviour with
1.6.0_03 and 1.5.0_13 JDKs.
Am I running the right test?
Mark
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org