You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avalon.apache.org by Harmeet Bedi <hb...@yahoo.com> on 2001/03/21 10:58:15 UTC

possible problem with scheduler.

Test Done.
========
1.
Hit refresh repeatedly in Outlook express Email Client. This exercised the
POP3 Server. The mail client indicated error in a random mannner but
frequently.
2. Wrote automated test to stess and relibly reproduce POP Server problem.
Here is the test.
--------------------------------------
from poplib import POP3
import thread
from java.lang import Thread
def multipop(thread_count=1,seq=3):
    if thread_count == 1:
        for i in range(seq):
            print Thread.currentThread().getName(),i
            pop()
    else:
        for i in range(thread_count):
            thread.start_new_thread(mpop,(1,seq))

def pop(server='localhost',userid='harmeet',password='harmeet'):
    a = POP3(server)
    print a.getwelcome()
    a.user(userid)
    a.pass_(password)
    a.list()
    (numMsgs, totalSize) = a.stat()
    for i in range(1, numMsgs + 1):
        (header, msg, octets) = a.retr(i)
        print "Message ", `i`, ':'
        for line in msg:
            print '   ' + line
        print '-----------------------'
        a.quit()
--------------------------------------------------------

ran this test as
// hit pop server with 1 thread, each thread making 3 requests
pop()
// hit pop server with 5 threads, each thread making 5 requests
pop(5,5)
// hit pop server with 10 threads, each thread making 10 requests
pop(10,10)

Test Result
========
Got error response back. Modified code to dump stack trace.
Here are the interesting stack traces.
-----------------------------------------
java.lang.ArrayIndexOutOfBoundsException
at org.apache.avalon.util.BinaryHeap.percolateUpMinHeap(BinaryHeap.java:209)
at org.apache.avalon.util.BinaryHeap.insert(BinaryHeap.java:88)
at
org.apache.cornerstone.blocks.scheduler.DefaultTimeScheduler.rescheduleEntry
(DefaultTimeScheduler.java:130)
at
org.apache.cornerstone.blocks.scheduler.DefaultTimeScheduler.resetTrigger(De
faultTimeScheduler.java:101)
at
org.apache.james.pop3server.POP3Handler.handleConnection(POP3Handler.java:15
0)
at
org.apache.cornerstone.blocks.connection.ConnectionRunner.run(Connection.jav
a:128)
at org.apache.avalon.util.thread.WorkerThread.run(WorkerThread.java:76)

not as frequently, but this was another stack trace
java.lang.NullPointerException
at
org.apache.cornerstone.blocks.scheduler.TimeScheduledEntry.compareTo(TimeSch
eduledEntry.java:106)
at org.apache.avalon.util.BinaryHeap.percolateUpMinHeap(BinaryHeap.java:212)
at org.apache.avalon.util.BinaryHeap.insert(BinaryHeap.java:88)
at
org.apache.cornerstone.blocks.scheduler.DefaultTimeScheduler.rescheduleEntry
(DefaultTimeScheduler.java:130)
at
org.apache.cornerstone.blocks.scheduler.DefaultTimeScheduler.addTrigger(Defa
ultTimeScheduler.java:69)
at
org.apache.james.pop3server.POP3Handler.handleConnection(POP3Handler.java:14
5)
at
org.apache.cornerstone.blocks.connection.ConnectionRunner.run(Connection.jav
a:128)
at org.apache.avalon.util.thread.WorkerThread.run(WorkerThread.java:76)
----------------------------

These stack traces don't occur if there is a gap in client requests or in a
single client request. To me this indicates potential problems with
DefaultTimeScheduler. Has anyone seen such traces.

My code is a few days old, but I did get the latest code and compare the
changes. Did not upgrade. There seem to be inconsistency between Avalon and
James codebase.


What Worked
==========
Wrote a new implementation of scheduler service. This implementation seemed
to work. The tests above worked. :-)
I am attaching the service for your review.
There are some issues with it.
1. It is based on JDK 1.3 java.util.Timer class. I think the server side
code should be able to choose the environment, but this argument may not
work for all. The JDK Timer based mechanism is similar(maybe derived) to
TimeDaemon class from Doug Lea's  util.concurrent package. So it would be
easy to make this backward compatible.
2. The service assumes that TimerTrigger is of type PeriodicTimeTrigger. I
found that this is the only trigger usedin the current Avalon and James
codebase, except in tests.Needed to add these methods to PeriodicTimer to
covert to JDK/Doug Lea type schedule manager.
    public long getStartTime()
    {
        return m_startTime;
    }

    public long getPeriod()
    {
        return m_period;
    }

What are your thoughts. Have you seen simialar problems with scheduler. The
JDK/Doug Lea Trigger mechanism is very different from Avalon. Should Avalon
move and potentially reuse their model ?

Harmeet
P.S: Request - I would appreciate if someone adds the modifications to
PeriodicTimer. This solves a relibility problem for me. The changes to
PeriodicTimer would allow me to plugin into the current codebase cleanly.
- thanks.



_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


---------------------------------------------------------------------
To unsubscribe, e-mail: avalon-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: avalon-dev-help@jakarta.apache.org


Re: possible problem with scheduler.

Posted by Harmeet Bedi <hb...@yahoo.com>.
oops forgot to attach the TimeScheduler implementation that worked for me.

Harmeet
----- Original Message -----
From: "Harmeet Bedi" <hb...@yahoo.com>
To: <av...@jakarta.apache.org>; <ja...@jakarta.apache.org>
Sent: Wednesday, March 21, 2001 1:58 AM
Subject: possible problem with scheduler.


> Test Done.
> ========
> 1.
> Hit refresh repeatedly in Outlook express Email Client. This exercised the
> POP3 Server. The mail client indicated error in a random mannner but
> frequently.
> 2. Wrote automated test to stess and relibly reproduce POP Server problem.
> Here is the test.
> --------------------------------------
> from poplib import POP3
> import thread
> from java.lang import Thread
> def multipop(thread_count=1,seq=3):
>     if thread_count == 1:
>         for i in range(seq):
>             print Thread.currentThread().getName(),i
>             pop()
>     else:
>         for i in range(thread_count):
>             thread.start_new_thread(mpop,(1,seq))
>
> def pop(server='localhost',userid='harmeet',password='harmeet'):
>     a = POP3(server)
>     print a.getwelcome()
>     a.user(userid)
>     a.pass_(password)
>     a.list()
>     (numMsgs, totalSize) = a.stat()
>     for i in range(1, numMsgs + 1):
>         (header, msg, octets) = a.retr(i)
>         print "Message ", `i`, ':'
>         for line in msg:
>             print '   ' + line
>         print '-----------------------'
>         a.quit()
> --------------------------------------------------------
>
> ran this test as
> // hit pop server with 1 thread, each thread making 3 requests
> pop()
> // hit pop server with 5 threads, each thread making 5 requests
> pop(5,5)
> // hit pop server with 10 threads, each thread making 10 requests
> pop(10,10)
>
> Test Result
> ========
> Got error response back. Modified code to dump stack trace.
> Here are the interesting stack traces.
> -----------------------------------------
> java.lang.ArrayIndexOutOfBoundsException
> at
org.apache.avalon.util.BinaryHeap.percolateUpMinHeap(BinaryHeap.java:209)
> at org.apache.avalon.util.BinaryHeap.insert(BinaryHeap.java:88)
> at
>
org.apache.cornerstone.blocks.scheduler.DefaultTimeScheduler.rescheduleEntry
> (DefaultTimeScheduler.java:130)
> at
>
org.apache.cornerstone.blocks.scheduler.DefaultTimeScheduler.resetTrigger(De
> faultTimeScheduler.java:101)
> at
>
org.apache.james.pop3server.POP3Handler.handleConnection(POP3Handler.java:15
> 0)
> at
>
org.apache.cornerstone.blocks.connection.ConnectionRunner.run(Connection.jav
> a:128)
> at org.apache.avalon.util.thread.WorkerThread.run(WorkerThread.java:76)
>
> not as frequently, but this was another stack trace
> java.lang.NullPointerException
> at
>
org.apache.cornerstone.blocks.scheduler.TimeScheduledEntry.compareTo(TimeSch
> eduledEntry.java:106)
> at
org.apache.avalon.util.BinaryHeap.percolateUpMinHeap(BinaryHeap.java:212)
> at org.apache.avalon.util.BinaryHeap.insert(BinaryHeap.java:88)
> at
>
org.apache.cornerstone.blocks.scheduler.DefaultTimeScheduler.rescheduleEntry
> (DefaultTimeScheduler.java:130)
> at
>
org.apache.cornerstone.blocks.scheduler.DefaultTimeScheduler.addTrigger(Defa
> ultTimeScheduler.java:69)
> at
>
org.apache.james.pop3server.POP3Handler.handleConnection(POP3Handler.java:14
> 5)
> at
>
org.apache.cornerstone.blocks.connection.ConnectionRunner.run(Connection.jav
> a:128)
> at org.apache.avalon.util.thread.WorkerThread.run(WorkerThread.java:76)
> ----------------------------
>
> These stack traces don't occur if there is a gap in client requests or in
a
> single client request. To me this indicates potential problems with
> DefaultTimeScheduler. Has anyone seen such traces.
>
> My code is a few days old, but I did get the latest code and compare the
> changes. Did not upgrade. There seem to be inconsistency between Avalon
and
> James codebase.
>
>
> What Worked
> ==========
> Wrote a new implementation of scheduler service. This implementation
seemed
> to work. The tests above worked. :-)
> I am attaching the service for your review.
> There are some issues with it.
> 1. It is based on JDK 1.3 java.util.Timer class. I think the server side
> code should be able to choose the environment, but this argument may not
> work for all. The JDK Timer based mechanism is similar(maybe derived) to
> TimeDaemon class from Doug Lea's  util.concurrent package. So it would be
> easy to make this backward compatible.
> 2. The service assumes that TimerTrigger is of type PeriodicTimeTrigger. I
> found that this is the only trigger usedin the current Avalon and James
> codebase, except in tests.Needed to add these methods to PeriodicTimer to
> covert to JDK/Doug Lea type schedule manager.
>     public long getStartTime()
>     {
>         return m_startTime;
>     }
>
>     public long getPeriod()
>     {
>         return m_period;
>     }
>
> What are your thoughts. Have you seen simialar problems with scheduler.
The
> JDK/Doug Lea Trigger mechanism is very different from Avalon. Should
Avalon
> move and potentially reuse their model ?
>
> Harmeet
> P.S: Request - I would appreciate if someone adds the modifications to
> PeriodicTimer. This solves a relibility problem for me. The changes to
> PeriodicTimer would allow me to plugin into the current codebase cleanly.
> - thanks.
>
>
>
> _________________________________________________________
> Do You Yahoo!?
> Get your free @yahoo.com address at http://mail.yahoo.com
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: avalon-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: avalon-dev-help@jakarta.apache.org

Re: possible problem with scheduler.

Posted by Harmeet Bedi <hb...@yahoo.com>.
oops forgot to attach the TimeScheduler implementation that worked for me.

Harmeet
----- Original Message -----
From: "Harmeet Bedi" <hb...@yahoo.com>
To: <av...@jakarta.apache.org>; <ja...@jakarta.apache.org>
Sent: Wednesday, March 21, 2001 1:58 AM
Subject: possible problem with scheduler.


> Test Done.
> ========
> 1.
> Hit refresh repeatedly in Outlook express Email Client. This exercised the
> POP3 Server. The mail client indicated error in a random mannner but
> frequently.
> 2. Wrote automated test to stess and relibly reproduce POP Server problem.
> Here is the test.
> --------------------------------------
> from poplib import POP3
> import thread
> from java.lang import Thread
> def multipop(thread_count=1,seq=3):
>     if thread_count == 1:
>         for i in range(seq):
>             print Thread.currentThread().getName(),i
>             pop()
>     else:
>         for i in range(thread_count):
>             thread.start_new_thread(mpop,(1,seq))
>
> def pop(server='localhost',userid='harmeet',password='harmeet'):
>     a = POP3(server)
>     print a.getwelcome()
>     a.user(userid)
>     a.pass_(password)
>     a.list()
>     (numMsgs, totalSize) = a.stat()
>     for i in range(1, numMsgs + 1):
>         (header, msg, octets) = a.retr(i)
>         print "Message ", `i`, ':'
>         for line in msg:
>             print '   ' + line
>         print '-----------------------'
>         a.quit()
> --------------------------------------------------------
>
> ran this test as
> // hit pop server with 1 thread, each thread making 3 requests
> pop()
> // hit pop server with 5 threads, each thread making 5 requests
> pop(5,5)
> // hit pop server with 10 threads, each thread making 10 requests
> pop(10,10)
>
> Test Result
> ========
> Got error response back. Modified code to dump stack trace.
> Here are the interesting stack traces.
> -----------------------------------------
> java.lang.ArrayIndexOutOfBoundsException
> at
org.apache.avalon.util.BinaryHeap.percolateUpMinHeap(BinaryHeap.java:209)
> at org.apache.avalon.util.BinaryHeap.insert(BinaryHeap.java:88)
> at
>
org.apache.cornerstone.blocks.scheduler.DefaultTimeScheduler.rescheduleEntry
> (DefaultTimeScheduler.java:130)
> at
>
org.apache.cornerstone.blocks.scheduler.DefaultTimeScheduler.resetTrigger(De
> faultTimeScheduler.java:101)
> at
>
org.apache.james.pop3server.POP3Handler.handleConnection(POP3Handler.java:15
> 0)
> at
>
org.apache.cornerstone.blocks.connection.ConnectionRunner.run(Connection.jav
> a:128)
> at org.apache.avalon.util.thread.WorkerThread.run(WorkerThread.java:76)
>
> not as frequently, but this was another stack trace
> java.lang.NullPointerException
> at
>
org.apache.cornerstone.blocks.scheduler.TimeScheduledEntry.compareTo(TimeSch
> eduledEntry.java:106)
> at
org.apache.avalon.util.BinaryHeap.percolateUpMinHeap(BinaryHeap.java:212)
> at org.apache.avalon.util.BinaryHeap.insert(BinaryHeap.java:88)
> at
>
org.apache.cornerstone.blocks.scheduler.DefaultTimeScheduler.rescheduleEntry
> (DefaultTimeScheduler.java:130)
> at
>
org.apache.cornerstone.blocks.scheduler.DefaultTimeScheduler.addTrigger(Defa
> ultTimeScheduler.java:69)
> at
>
org.apache.james.pop3server.POP3Handler.handleConnection(POP3Handler.java:14
> 5)
> at
>
org.apache.cornerstone.blocks.connection.ConnectionRunner.run(Connection.jav
> a:128)
> at org.apache.avalon.util.thread.WorkerThread.run(WorkerThread.java:76)
> ----------------------------
>
> These stack traces don't occur if there is a gap in client requests or in
a
> single client request. To me this indicates potential problems with
> DefaultTimeScheduler. Has anyone seen such traces.
>
> My code is a few days old, but I did get the latest code and compare the
> changes. Did not upgrade. There seem to be inconsistency between Avalon
and
> James codebase.
>
>
> What Worked
> ==========
> Wrote a new implementation of scheduler service. This implementation
seemed
> to work. The tests above worked. :-)
> I am attaching the service for your review.
> There are some issues with it.
> 1. It is based on JDK 1.3 java.util.Timer class. I think the server side
> code should be able to choose the environment, but this argument may not
> work for all. The JDK Timer based mechanism is similar(maybe derived) to
> TimeDaemon class from Doug Lea's  util.concurrent package. So it would be
> easy to make this backward compatible.
> 2. The service assumes that TimerTrigger is of type PeriodicTimeTrigger. I
> found that this is the only trigger usedin the current Avalon and James
> codebase, except in tests.Needed to add these methods to PeriodicTimer to
> covert to JDK/Doug Lea type schedule manager.
>     public long getStartTime()
>     {
>         return m_startTime;
>     }
>
>     public long getPeriod()
>     {
>         return m_period;
>     }
>
> What are your thoughts. Have you seen simialar problems with scheduler.
The
> JDK/Doug Lea Trigger mechanism is very different from Avalon. Should
Avalon
> move and potentially reuse their model ?
>
> Harmeet
> P.S: Request - I would appreciate if someone adds the modifications to
> PeriodicTimer. This solves a relibility problem for me. The changes to
> PeriodicTimer would allow me to plugin into the current codebase cleanly.
> - thanks.
>
>
>
> _________________________________________________________
> Do You Yahoo!?
> Get your free @yahoo.com address at http://mail.yahoo.com
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: avalon-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: avalon-dev-help@jakarta.apache.org

Re: possible problem with scheduler.

Posted by Peter Donald <do...@apache.org>.
At 06:47  21/3/01 -0800, Harmeet Bedi wrote:
>> >What Worked
>> >==========
>>
>> JDK1.3 is currently not allowed because we want to keep compatible with
>> with 1.2.
>
>One could take the JDK 1.3 Timer classes and use them with 1.2 VM, either as
>is or in a different package. So I think it should be possible to do this in
>JDK 1.2.

not legal and thus a nogo here ;)

>Here is the addition to PeriodicTimer that would help a lot.
>     public long getStartTime()
>     {
>         return m_startTime;
>     }
>
>     public long getPeriod()
>     {
>         return m_period;
>     }

added
Cheers,

Pete

*-----------------------------------------------------*
| "Faced with the choice between changing one's mind, |
| and proving that there is no need to do so - almost |
| everyone gets busy on the proof."                   |
|              - John Kenneth Galbraith               |
*-----------------------------------------------------*


---------------------------------------------------------------------
To unsubscribe, e-mail: avalon-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: avalon-dev-help@jakarta.apache.org


Re: possible problem with scheduler.

Posted by Harmeet Bedi <hb...@yahoo.com>.
----- Original Message -----
From: "Peter Donald" <do...@apache.org>
Sent: Wednesday, March 21, 2001 2:46 AM


> At 01:58  21/3/01 -0800, Harmeet Bedi wrote:
> yay python ! ;)

python rocks. :-)

>
> >Got error response back. Modified code to dump stack trace.
> >Here are the interesting stack traces.
> >-----------------------------------------
> >java.lang.ArrayIndexOutOfBoundsException
> >at
org.apache.avalon.util.BinaryHeap.percolateUpMinHeap(BinaryHeap.java:209)
>
> this has been fixed by Ram just recently. I will update the jars to AValon
> as appropriate.

I looked at the diffs, could not understand how it was fixed, but I will try
again.

> >JDK/Doug Lea Trigger mechanism is very different from Avalon. Should
Avalon
> >move and potentially reuse their model ?
>
> actually there model is identical. If you look at the javadocs they use a
> binary heap aswell and have all the same features (ie can scale to
thousands).

The interface seem to be different. JDK Timer class does not seem
to have an equivalent of TimeTrigger interface. The implemention seems to be
similar not the API. :-(
JDK seems to have the TimeTrigger functionality rolled into their
scheduler - Timer object.

> >What Worked
> >==========
>
> JDK1.3 is currently not allowed because we want to keep compatible with
> with 1.2.

One could take the JDK 1.3 Timer classes and use them with 1.2 VM, either as
is or in a different package. So I think it should be possible to do this in
JDK 1.2.


> >P.S: Request - I would appreciate if someone adds the modifications to
> >PeriodicTimer. This solves a relibility problem for me. The changes to
> >PeriodicTimer would allow me to plugin into the current codebase cleanly.
>
> You never sent this - even in the second email ;)

Here is the addition to PeriodicTimer that would help a lot.
     public long getStartTime()
     {
         return m_startTime;
     }

     public long getPeriod()
     {
         return m_period;
     }

Would appreciate if someone could make these changes.
thanks,
Harmeet



_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


---------------------------------------------------------------------
To unsubscribe, e-mail: james-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-dev-help@jakarta.apache.org


Re: possible problem with scheduler.

Posted by Harmeet Bedi <hb...@yahoo.com>.
----- Original Message -----
From: "Peter Donald" <do...@apache.org>
Sent: Wednesday, March 21, 2001 2:46 AM


> At 01:58  21/3/01 -0800, Harmeet Bedi wrote:
> yay python ! ;)

python rocks. :-)

>
> >Got error response back. Modified code to dump stack trace.
> >Here are the interesting stack traces.
> >-----------------------------------------
> >java.lang.ArrayIndexOutOfBoundsException
> >at
org.apache.avalon.util.BinaryHeap.percolateUpMinHeap(BinaryHeap.java:209)
>
> this has been fixed by Ram just recently. I will update the jars to AValon
> as appropriate.

I looked at the diffs, could not understand how it was fixed, but I will try
again.

> >JDK/Doug Lea Trigger mechanism is very different from Avalon. Should
Avalon
> >move and potentially reuse their model ?
>
> actually there model is identical. If you look at the javadocs they use a
> binary heap aswell and have all the same features (ie can scale to
thousands).

The interface seem to be different. JDK Timer class does not seem
to have an equivalent of TimeTrigger interface. The implemention seems to be
similar not the API. :-(
JDK seems to have the TimeTrigger functionality rolled into their
scheduler - Timer object.

> >What Worked
> >==========
>
> JDK1.3 is currently not allowed because we want to keep compatible with
> with 1.2.

One could take the JDK 1.3 Timer classes and use them with 1.2 VM, either as
is or in a different package. So I think it should be possible to do this in
JDK 1.2.


> >P.S: Request - I would appreciate if someone adds the modifications to
> >PeriodicTimer. This solves a relibility problem for me. The changes to
> >PeriodicTimer would allow me to plugin into the current codebase cleanly.
>
> You never sent this - even in the second email ;)

Here is the addition to PeriodicTimer that would help a lot.
     public long getStartTime()
     {
         return m_startTime;
     }

     public long getPeriod()
     {
         return m_period;
     }

Would appreciate if someone could make these changes.
thanks,
Harmeet



_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


---------------------------------------------------------------------
To unsubscribe, e-mail: avalon-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: avalon-dev-help@jakarta.apache.org


Re: possible problem with scheduler.

Posted by Peter Donald <do...@apache.org>.
At 01:58  21/3/01 -0800, Harmeet Bedi wrote:
>2. Wrote automated test to stess and relibly reproduce POP Server problem.
>Here is the test.

yay python ! ;)

>Got error response back. Modified code to dump stack trace.
>Here are the interesting stack traces.
>-----------------------------------------
>java.lang.ArrayIndexOutOfBoundsException
>at org.apache.avalon.util.BinaryHeap.percolateUpMinHeap(BinaryHeap.java:209)

this has been fixed by Ram just recently. I will update the jars to AValon
as appropriate.

>not as frequently, but this was another stack trace
>java.lang.NullPointerException

This could be a threading issue that was also fixed by Ram recently .. not
sure. Wait A bit and I will upload jars to jkarta-james and then you can
see if that fixes the problem.

>These stack traces don't occur if there is a gap in client requests or in a
>single client request. To me this indicates potential problems with
>DefaultTimeScheduler. Has anyone seen such traces.

yup - it was relatively untested code in one particular aspect - which of
course james stress tested ;)

>What Worked
>==========
>Wrote a new implementation of scheduler service. This implementation seemed
>to work. The tests above worked. :-)
>I am attaching the service for your review.
>There are some issues with it.
>1. It is based on JDK 1.3 java.util.Timer class. I think the server side
>code should be able to choose the environment, but this argument may not
>work for all. The JDK Timer based mechanism is similar(maybe derived) to
>TimeDaemon class from Doug Lea's  util.concurrent package. So it would be
>easy to make this backward compatible.

JDK1.3 is currently not allowed because we want to keep compatible with
with 1.2.

>2. The service assumes that TimerTrigger is of type PeriodicTimeTrigger. I
>found that this is the only trigger usedin the current Avalon and James
>codebase, except in tests.Needed to add these methods to PeriodicTimer to
>covert to JDK/Doug Lea type schedule manager.

but CronTimeTrigger is used in my own personal codebase ;)

>What are your thoughts. Have you seen simialar problems with scheduler. The
>JDK/Doug Lea Trigger mechanism is very different from Avalon. Should Avalon
>move and potentially reuse their model ?

actually there model is identical. If you look at the javadocs they use a
binary heap aswell and have all the same features (ie can scale to thousands).

>P.S: Request - I would appreciate if someone adds the modifications to
>PeriodicTimer. This solves a relibility problem for me. The changes to
>PeriodicTimer would allow me to plugin into the current codebase cleanly.

You never sent this - even in the second email ;)

Cheers,

Pete

*-----------------------------------------------------*
| "Faced with the choice between changing one's mind, |
| and proving that there is no need to do so - almost |
| everyone gets busy on the proof."                   |
|              - John Kenneth Galbraith               |
*-----------------------------------------------------*


---------------------------------------------------------------------
To unsubscribe, e-mail: james-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-dev-help@jakarta.apache.org


Re: possible problem with scheduler.

Posted by Peter Donald <do...@apache.org>.
At 01:58  21/3/01 -0800, Harmeet Bedi wrote:
>2. Wrote automated test to stess and relibly reproduce POP Server problem.
>Here is the test.

yay python ! ;)

>Got error response back. Modified code to dump stack trace.
>Here are the interesting stack traces.
>-----------------------------------------
>java.lang.ArrayIndexOutOfBoundsException
>at org.apache.avalon.util.BinaryHeap.percolateUpMinHeap(BinaryHeap.java:209)

this has been fixed by Ram just recently. I will update the jars to AValon
as appropriate.

>not as frequently, but this was another stack trace
>java.lang.NullPointerException

This could be a threading issue that was also fixed by Ram recently .. not
sure. Wait A bit and I will upload jars to jkarta-james and then you can
see if that fixes the problem.

>These stack traces don't occur if there is a gap in client requests or in a
>single client request. To me this indicates potential problems with
>DefaultTimeScheduler. Has anyone seen such traces.

yup - it was relatively untested code in one particular aspect - which of
course james stress tested ;)

>What Worked
>==========
>Wrote a new implementation of scheduler service. This implementation seemed
>to work. The tests above worked. :-)
>I am attaching the service for your review.
>There are some issues with it.
>1. It is based on JDK 1.3 java.util.Timer class. I think the server side
>code should be able to choose the environment, but this argument may not
>work for all. The JDK Timer based mechanism is similar(maybe derived) to
>TimeDaemon class from Doug Lea's  util.concurrent package. So it would be
>easy to make this backward compatible.

JDK1.3 is currently not allowed because we want to keep compatible with
with 1.2.

>2. The service assumes that TimerTrigger is of type PeriodicTimeTrigger. I
>found that this is the only trigger usedin the current Avalon and James
>codebase, except in tests.Needed to add these methods to PeriodicTimer to
>covert to JDK/Doug Lea type schedule manager.

but CronTimeTrigger is used in my own personal codebase ;)

>What are your thoughts. Have you seen simialar problems with scheduler. The
>JDK/Doug Lea Trigger mechanism is very different from Avalon. Should Avalon
>move and potentially reuse their model ?

actually there model is identical. If you look at the javadocs they use a
binary heap aswell and have all the same features (ie can scale to thousands).

>P.S: Request - I would appreciate if someone adds the modifications to
>PeriodicTimer. This solves a relibility problem for me. The changes to
>PeriodicTimer would allow me to plugin into the current codebase cleanly.

You never sent this - even in the second email ;)

Cheers,

Pete

*-----------------------------------------------------*
| "Faced with the choice between changing one's mind, |
| and proving that there is no need to do so - almost |
| everyone gets busy on the proof."                   |
|              - John Kenneth Galbraith               |
*-----------------------------------------------------*


---------------------------------------------------------------------
To unsubscribe, e-mail: avalon-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: avalon-dev-help@jakarta.apache.org