Is there any way to clear scheduler schedule "for sure"? When I "turn
off" scheduler with: <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:oxf="http://www.orbeon.com/oxf/processors" xmlns:xxforms="http://orbeon.org/oxf/xml/xforms" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:p="http://www.orbeon.com/oxf/pipeline" xmlns:saxon="http://saxon.sf.net/" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:fn="http://www.w3.org/2005/02/xpath-functions"> <stop-task> <name>invpull-task</name> </stop-task> </config> ...and then turn it back on again with: <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:oxf="http://www.orbeon.com/oxf/processors" xmlns:xxforms="http://orbeon.org/oxf/xml/xforms" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:p="http://www.orbeon.com/oxf/pipeline" xmlns:saxon="http://saxon.sf.net/" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:fn="http://www.w3.org/2005/02/xpath-functions"> <start-task> <name>invpull-task</name> <start-time>2006-02-28T09:13:00</start-time> <interval>3600000</interval> <processor-name>oxf:pipeline</processor-name> <input name="config" url="oxf:/convert/invpull-autorun.xpl"/> </start-task> </config> I see in the console the "invpull-task " to be run not once, but several times with interval much shorter than 1 hour (which is the value of the scheduled interval) which raises suspicion that the previous tasks were not cleared when I stopped the execution. I did try to restart tomcat, but that did not seem to have an effect. Also, right after I turn scheduler on, I see a bunch of lines shown below which looks like some pending tasks to me. 2006-03-03 09:32:50,988 INFO org.orbeon.oxf.processor.SchedulerProcessor null - /convert - Received request 2006-03-03 09:32:50,995 INFO org.orbeon.oxf.processor.SchedulerProcessor null - /convert - Received request 2006-03-03 09:32:50,999 INFO org.orbeon.oxf.processor.SchedulerProcessor null - /convert - Received request Lastly, I did a test where I set the the schedule start time to the future, but just a minute or so after starting the scheduler, I see in the console the scheduled task being executed. A. -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
I set the value of the "synchronized" config element to "true" and
indeed - when trying to start the scheduler, I see line: 2006-03-03 09:58:00,012 INFO org.orbeon.oxf.processor.SchedulerProcessor null - Task: invpull-task won't run since it is already running ... so I guess I am not succeeding stopping the task. Restarting tomcat does not help. A. On Mar 3, 2006, at 9:37 AM, Alexander Zatko wrote: > Is there any way to clear scheduler schedule "for sure"? When I "turn > off" scheduler with: > > <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xmlns:oxf="http://www.orbeon.com/oxf/processors" > xmlns:xxforms="http://orbeon.org/oxf/xml/xforms" > xmlns:xs="http://www.w3.org/2001/XMLSchema" > xmlns:p="http://www.orbeon.com/oxf/pipeline" > xmlns:saxon="http://saxon.sf.net/" > xmlns:xforms="http://www.w3.org/2002/xforms" > xmlns:fn="http://www.w3.org/2005/02/xpath-functions"> > <stop-task> > <name>invpull-task</name> > </stop-task> > </config> > > ...and then turn it back on again with: > > <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xmlns:oxf="http://www.orbeon.com/oxf/processors" > xmlns:xxforms="http://orbeon.org/oxf/xml/xforms" > xmlns:xs="http://www.w3.org/2001/XMLSchema" > xmlns:p="http://www.orbeon.com/oxf/pipeline" > xmlns:saxon="http://saxon.sf.net/" > xmlns:xforms="http://www.w3.org/2002/xforms" > xmlns:fn="http://www.w3.org/2005/02/xpath-functions"> > <start-task> > <name>invpull-task</name> > <start-time>2006-02-28T09:13:00</start-time> > <interval>3600000</interval> > <processor-name>oxf:pipeline</processor-name> > <input name="config" url="oxf:/convert/invpull-autorun.xpl"/> > </start-task> > </config> > > I see in the console the "invpull-task " to be run not once, but > several times with interval much shorter than 1 hour (which is the > value of the scheduled interval) which raises suspicion that the > previous tasks were not cleared when I stopped the execution. I did > try to restart tomcat, but that did not seem to have an effect. > > Also, right after I turn scheduler on, I see a bunch of lines shown > below which looks like some pending tasks to me. > > 2006-03-03 09:32:50,988 INFO > org.orbeon.oxf.processor.SchedulerProcessor null - /convert - Received > request > 2006-03-03 09:32:50,995 INFO > org.orbeon.oxf.processor.SchedulerProcessor null - /convert - Received > request > 2006-03-03 09:32:50,999 INFO > org.orbeon.oxf.processor.SchedulerProcessor null - /convert - Received > request > > Lastly, I did a test where I set the the schedule start time to the > future, but just a minute or so after starting the scheduler, I see in > the console the scheduled task being executed. > > A. > -- > You receive this message as a subscriber of the > [hidden email] mailing list. > To unsubscribe: mailto:[hidden email] > For general help: mailto:[hidden email]?subject=help > ObjectWeb mailing lists service home page: http://www.objectweb.org/wws -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Administrator
|
Alex,
I tried to reproduce the problem, but stopping a scheduled task worked fine for me. In the examples, I modified context\context-initialized.xpl to run the task every 2 seconds with <interval>2000</interval>. Since there is a "debug" in oxf:/context/scheduled-task.xpl, when the task is running I see entry in the log every 2 seconds. I added to page-flow.xml this line: <page path-info="/stop" model="context/context-destroyed.xpl"/>. This will run context-destroyed.xpl which stops that task when the page /stop is loaded. As soon as I load /stop in the browser, I stop getting an entry in the log every 2 seconds, which shows that the task has been stopped. I think that to help further you would need to create for us a test case that we can run locally and that shows the issue. Alex On 3/3/06, Alexander Zatko <[hidden email]> wrote: > I set the value of the "synchronized" config element to "true" and > indeed - when trying to start the scheduler, I see line: > > 2006-03-03 09:58:00,012 INFO > org.orbeon.oxf.processor.SchedulerProcessor null - Task: invpull-task > won't run since it is already running > > ... so I guess I am not succeeding stopping the task. Restarting tomcat > does not help. > > A. > > On Mar 3, 2006, at 9:37 AM, Alexander Zatko wrote: > > > Is there any way to clear scheduler schedule "for sure"? When I "turn > > off" scheduler with: > > > > <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > > xmlns:oxf="http://www.orbeon.com/oxf/processors" > > xmlns:xxforms="http://orbeon.org/oxf/xml/xforms" > > xmlns:xs="http://www.w3.org/2001/XMLSchema" > > xmlns:p="http://www.orbeon.com/oxf/pipeline" > > xmlns:saxon="http://saxon.sf.net/" > > xmlns:xforms="http://www.w3.org/2002/xforms" > > xmlns:fn="http://www.w3.org/2005/02/xpath-functions"> > > <stop-task> > > <name>invpull-task</name> > > </stop-task> > > </config> > > > > ...and then turn it back on again with: > > > > <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > > xmlns:oxf="http://www.orbeon.com/oxf/processors" > > xmlns:xxforms="http://orbeon.org/oxf/xml/xforms" > > xmlns:xs="http://www.w3.org/2001/XMLSchema" > > xmlns:p="http://www.orbeon.com/oxf/pipeline" > > xmlns:saxon="http://saxon.sf.net/" > > xmlns:xforms="http://www.w3.org/2002/xforms" > > xmlns:fn="http://www.w3.org/2005/02/xpath-functions"> > > <start-task> > > <name>invpull-task</name> > > <start-time>2006-02-28T09:13:00</start-time> > > <interval>3600000</interval> > > <processor-name>oxf:pipeline</processor-name> > > <input name="config" url="oxf:/convert/invpull-autorun.xpl"/> > > </start-task> > > </config> > > > > I see in the console the "invpull-task " to be run not once, but > > several times with interval much shorter than 1 hour (which is the > > value of the scheduled interval) which raises suspicion that the > > previous tasks were not cleared when I stopped the execution. I did > > try to restart tomcat, but that did not seem to have an effect. > > > > Also, right after I turn scheduler on, I see a bunch of lines shown > > below which looks like some pending tasks to me. > > > > 2006-03-03 09:32:50,988 INFO > > org.orbeon.oxf.processor.SchedulerProcessor null - /convert - Received > > request > > 2006-03-03 09:32:50,995 INFO > > org.orbeon.oxf.processor.SchedulerProcessor null - /convert - Received > > request > > 2006-03-03 09:32:50,999 INFO > > org.orbeon.oxf.processor.SchedulerProcessor null - /convert - Received > > request > > > > Lastly, I did a test where I set the the schedule start time to the > > future, but just a minute or so after starting the scheduler, I see in > > the console the scheduled task being executed. > > > > A. > > -- > > You receive this message as a subscriber of the > > [hidden email] mailing list. > > To unsubscribe: mailto:[hidden email] > > For general help: mailto:[hidden email]?subject=help > > ObjectWeb mailing lists service home page: http://www.objectweb.org/wws > > > > > > -- > You receive this message as a subscriber of the [hidden email] mailing list. > To unsubscribe: mailto:[hidden email] > For general help: mailto:[hidden email]?subject=help > ObjectWeb mailing lists service home page: http://www.objectweb.org/wws > > > -- Blog (XML, Web apps, Open Source): http://www.orbeon.com/blog/ -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
--
Follow Orbeon on Twitter: @orbeon Follow me on Twitter: @avernet |
Alex,
Not sure how to create a reproducible case for this. I will try to deploy the app on a Windows machine first to see if that changes anything. Thank you. A. On Mar 3, 2006, at 3:39 PM, Alessandro Vernet wrote: > Alex, > > I tried to reproduce the problem, but stopping a scheduled task worked > fine for me. In the examples, I modified > context\context-initialized.xpl to run the task every 2 seconds with > <interval>2000</interval>. Since there is a "debug" in > oxf:/context/scheduled-task.xpl, when the task is running I see entry > in the log every 2 seconds. > > I added to page-flow.xml this line: <page path-info="/stop" > model="context/context-destroyed.xpl"/>. This will run > context-destroyed.xpl which stops that task when the page /stop is > loaded. As soon as I load /stop in the browser, I stop getting an > entry in the log every 2 seconds, which shows that the task has been > stopped. > > I think that to help further you would need to create for us a test > case that we can run locally and that shows the issue. > > Alex > > On 3/3/06, Alexander Zatko <[hidden email]> wrote: >> I set the value of the "synchronized" config element to "true" and >> indeed - when trying to start the scheduler, I see line: >> >> 2006-03-03 09:58:00,012 INFO >> org.orbeon.oxf.processor.SchedulerProcessor null - Task: invpull-task >> won't run since it is already running >> >> ... so I guess I am not succeeding stopping the task. Restarting >> tomcat >> does not help. >> >> A. >> >> On Mar 3, 2006, at 9:37 AM, Alexander Zatko wrote: >> >>> Is there any way to clear scheduler schedule "for sure"? When I "turn >>> off" scheduler with: >>> >>> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >>> xmlns:oxf="http://www.orbeon.com/oxf/processors" >>> xmlns:xxforms="http://orbeon.org/oxf/xml/xforms" >>> xmlns:xs="http://www.w3.org/2001/XMLSchema" >>> xmlns:p="http://www.orbeon.com/oxf/pipeline" >>> xmlns:saxon="http://saxon.sf.net/" >>> xmlns:xforms="http://www.w3.org/2002/xforms" >>> xmlns:fn="http://www.w3.org/2005/02/xpath-functions"> >>> <stop-task> >>> <name>invpull-task</name> >>> </stop-task> >>> </config> >>> >>> ...and then turn it back on again with: >>> >>> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >>> xmlns:oxf="http://www.orbeon.com/oxf/processors" >>> xmlns:xxforms="http://orbeon.org/oxf/xml/xforms" >>> xmlns:xs="http://www.w3.org/2001/XMLSchema" >>> xmlns:p="http://www.orbeon.com/oxf/pipeline" >>> xmlns:saxon="http://saxon.sf.net/" >>> xmlns:xforms="http://www.w3.org/2002/xforms" >>> xmlns:fn="http://www.w3.org/2005/02/xpath-functions"> >>> <start-task> >>> <name>invpull-task</name> >>> <start-time>2006-02-28T09:13:00</start-time> >>> <interval>3600000</interval> >>> <processor-name>oxf:pipeline</processor-name> >>> <input name="config" url="oxf:/convert/invpull-autorun.xpl"/> >>> </start-task> >>> </config> >>> >>> I see in the console the "invpull-task " to be run not once, but >>> several times with interval much shorter than 1 hour (which is the >>> value of the scheduled interval) which raises suspicion that the >>> previous tasks were not cleared when I stopped the execution. I did >>> try to restart tomcat, but that did not seem to have an effect. >>> >>> Also, right after I turn scheduler on, I see a bunch of lines shown >>> below which looks like some pending tasks to me. >>> >>> 2006-03-03 09:32:50,988 INFO >>> org.orbeon.oxf.processor.SchedulerProcessor null - /convert - >>> Received >>> request >>> 2006-03-03 09:32:50,995 INFO >>> org.orbeon.oxf.processor.SchedulerProcessor null - /convert - >>> Received >>> request >>> 2006-03-03 09:32:50,999 INFO >>> org.orbeon.oxf.processor.SchedulerProcessor null - /convert - >>> Received >>> request >>> >>> Lastly, I did a test where I set the the schedule start time to the >>> future, but just a minute or so after starting the scheduler, I see >>> in >>> the console the scheduled task being executed. >>> >>> A. >>> -- >>> You receive this message as a subscriber of the >>> [hidden email] mailing list. >>> To unsubscribe: mailto:[hidden email] >>> For general help: mailto:[hidden email]?subject=help >>> ObjectWeb mailing lists service home page: >>> http://www.objectweb.org/wws >> >> >> >> >> >> -- >> You receive this message as a subscriber of the >> [hidden email] mailing list. >> To unsubscribe: mailto:[hidden email] >> For general help: mailto:[hidden email]?subject=help >> ObjectWeb mailing lists service home page: >> http://www.objectweb.org/wws >> >> >> > > -- > Blog (XML, Web apps, Open Source): > http://www.orbeon.com/blog/ > > > -- > You receive this message as a subscriber of the > [hidden email] mailing list. > To unsubscribe: mailto:[hidden email] > For general help: mailto:[hidden email]?subject=help > ObjectWeb mailing lists service home page: http://www.objectweb.org/wws -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Administrator
|
Alex,
Alright, then I'll wait for more information from you on this one. Alex On 3/3/06, Alexander Zatko <[hidden email]> wrote: > Alex, > > Not sure how to create a reproducible case for this. I will try to > deploy the app on a Windows machine first to see if that changes > anything. > > Thank you. > > A. > > > On Mar 3, 2006, at 3:39 PM, Alessandro Vernet wrote: > > > Alex, > > > > I tried to reproduce the problem, but stopping a scheduled task worked > > fine for me. In the examples, I modified > > context\context-initialized.xpl to run the task every 2 seconds with > > <interval>2000</interval>. Since there is a "debug" in > > oxf:/context/scheduled-task.xpl, when the task is running I see entry > > in the log every 2 seconds. > > > > I added to page-flow.xml this line: <page path-info="/stop" > > model="context/context-destroyed.xpl"/>. This will run > > context-destroyed.xpl which stops that task when the page /stop is > > loaded. As soon as I load /stop in the browser, I stop getting an > > entry in the log every 2 seconds, which shows that the task has been > > stopped. > > > > I think that to help further you would need to create for us a test > > case that we can run locally and that shows the issue. > > > > Alex > > > > On 3/3/06, Alexander Zatko <[hidden email]> wrote: > >> I set the value of the "synchronized" config element to "true" and > >> indeed - when trying to start the scheduler, I see line: > >> > >> 2006-03-03 09:58:00,012 INFO > >> org.orbeon.oxf.processor.SchedulerProcessor null - Task: invpull-task > >> won't run since it is already running > >> > >> ... so I guess I am not succeeding stopping the task. Restarting > >> tomcat > >> does not help. > >> > >> A. > >> > >> On Mar 3, 2006, at 9:37 AM, Alexander Zatko wrote: > >> > >>> Is there any way to clear scheduler schedule "for sure"? When I "turn > >>> off" scheduler with: > >>> > >>> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > >>> xmlns:oxf="http://www.orbeon.com/oxf/processors" > >>> xmlns:xxforms="http://orbeon.org/oxf/xml/xforms" > >>> xmlns:xs="http://www.w3.org/2001/XMLSchema" > >>> xmlns:p="http://www.orbeon.com/oxf/pipeline" > >>> xmlns:saxon="http://saxon.sf.net/" > >>> xmlns:xforms="http://www.w3.org/2002/xforms" > >>> xmlns:fn="http://www.w3.org/2005/02/xpath-functions"> > >>> <stop-task> > >>> <name>invpull-task</name> > >>> </stop-task> > >>> </config> > >>> > >>> ...and then turn it back on again with: > >>> > >>> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > >>> xmlns:oxf="http://www.orbeon.com/oxf/processors" > >>> xmlns:xxforms="http://orbeon.org/oxf/xml/xforms" > >>> xmlns:xs="http://www.w3.org/2001/XMLSchema" > >>> xmlns:p="http://www.orbeon.com/oxf/pipeline" > >>> xmlns:saxon="http://saxon.sf.net/" > >>> xmlns:xforms="http://www.w3.org/2002/xforms" > >>> xmlns:fn="http://www.w3.org/2005/02/xpath-functions"> > >>> <start-task> > >>> <name>invpull-task</name> > >>> <start-time>2006-02-28T09:13:00</start-time> > >>> <interval>3600000</interval> > >>> <processor-name>oxf:pipeline</processor-name> > >>> <input name="config" url="oxf:/convert/invpull-autorun.xpl"/> > >>> </start-task> > >>> </config> > >>> > >>> I see in the console the "invpull-task " to be run not once, but > >>> several times with interval much shorter than 1 hour (which is the > >>> value of the scheduled interval) which raises suspicion that the > >>> previous tasks were not cleared when I stopped the execution. I did > >>> try to restart tomcat, but that did not seem to have an effect. > >>> > >>> Also, right after I turn scheduler on, I see a bunch of lines shown > >>> below which looks like some pending tasks to me. > >>> > >>> 2006-03-03 09:32:50,988 INFO > >>> org.orbeon.oxf.processor.SchedulerProcessor null - /convert - > >>> Received > >>> request > >>> 2006-03-03 09:32:50,995 INFO > >>> org.orbeon.oxf.processor.SchedulerProcessor null - /convert - > >>> Received > >>> request > >>> 2006-03-03 09:32:50,999 INFO > >>> org.orbeon.oxf.processor.SchedulerProcessor null - /convert - > >>> Received > >>> request > >>> > >>> Lastly, I did a test where I set the the schedule start time to the > >>> future, but just a minute or so after starting the scheduler, I see > >>> in > >>> the console the scheduled task being executed. > >>> > >>> A. > >>> -- > >>> You receive this message as a subscriber of the > >>> [hidden email] mailing list. > >>> To unsubscribe: mailto:[hidden email] > >>> For general help: mailto:[hidden email]?subject=help > >>> ObjectWeb mailing lists service home page: > >>> http://www.objectweb.org/wws > >> > >> > >> > >> > >> > >> -- > >> You receive this message as a subscriber of the > >> [hidden email] mailing list. > >> To unsubscribe: mailto:[hidden email] > >> For general help: mailto:[hidden email]?subject=help > >> ObjectWeb mailing lists service home page: > >> http://www.objectweb.org/wws > >> > >> > >> > > > > -- > > Blog (XML, Web apps, Open Source): > > http://www.orbeon.com/blog/ > > > > > > -- > > You receive this message as a subscriber of the > > [hidden email] mailing list. > > To unsubscribe: mailto:[hidden email] > > For general help: mailto:[hidden email]?subject=help > > ObjectWeb mailing lists service home page: http://www.objectweb.org/wws > > > > > > -- > You receive this message as a subscriber of the [hidden email] mailing list. > To unsubscribe: mailto:[hidden email] > For general help: mailto:[hidden email]?subject=help > ObjectWeb mailing lists service home page: http://www.objectweb.org/wws > > > -- Blog (XML, Web apps, Open Source): http://www.orbeon.com/blog/ -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
--
Follow Orbeon on Twitter: @orbeon Follow me on Twitter: @avernet |
Alex,
I did some testing and I believe I figured out where the problem is. 1) When a start-time is supplied earlier than "now", the processor will use the interval value to process all of the "missed" scheduling events. 2) simply switching the task off does not seem to clear the list of missed events. After starting the same task again, the scheduler will start processing the task even if the newly-supplied start-time is way in the future. Maybe there are use cases where this behavior is the desired one, but it is not the one I am trying to address. :-) To work around this I ensured that start-time is always "now", or in the future, but maybe it would be worth considering to provide a new parameter to allow user to specify whether missed events should be processed, with the default set to "false"? If you want to play with this I have a simple test case that I can send to you. A. On Mar 3, 2006, at 10:00 PM, Alessandro Vernet wrote: > Alex, > > Alright, then I'll wait for more information from you on this one. > > Alex > > On 3/3/06, Alexander Zatko <[hidden email]> wrote: >> Alex, >> >> Not sure how to create a reproducible case for this. I will try to >> deploy the app on a Windows machine first to see if that changes >> anything. >> >> Thank you. >> >> A. >> >> >> On Mar 3, 2006, at 3:39 PM, Alessandro Vernet wrote: >> >>> Alex, >>> >>> I tried to reproduce the problem, but stopping a scheduled task >>> worked >>> fine for me. In the examples, I modified >>> context\context-initialized.xpl to run the task every 2 seconds with >>> <interval>2000</interval>. Since there is a "debug" in >>> oxf:/context/scheduled-task.xpl, when the task is running I see entry >>> in the log every 2 seconds. >>> >>> I added to page-flow.xml this line: <page path-info="/stop" >>> model="context/context-destroyed.xpl"/>. This will run >>> context-destroyed.xpl which stops that task when the page /stop is >>> loaded. As soon as I load /stop in the browser, I stop getting an >>> entry in the log every 2 seconds, which shows that the task has been >>> stopped. >>> >>> I think that to help further you would need to create for us a test >>> case that we can run locally and that shows the issue. >>> >>> Alex >>> >>> On 3/3/06, Alexander Zatko <[hidden email]> wrote: >>>> I set the value of the "synchronized" config element to "true" and >>>> indeed - when trying to start the scheduler, I see line: >>>> >>>> 2006-03-03 09:58:00,012 INFO >>>> org.orbeon.oxf.processor.SchedulerProcessor null - Task: >>>> invpull-task >>>> won't run since it is already running >>>> >>>> ... so I guess I am not succeeding stopping the task. Restarting >>>> tomcat >>>> does not help. >>>> >>>> A. >>>> >>>> On Mar 3, 2006, at 9:37 AM, Alexander Zatko wrote: >>>> >>>>> Is there any way to clear scheduler schedule "for sure"? When I >>>>> "turn >>>>> off" scheduler with: >>>>> >>>>> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >>>>> xmlns:oxf="http://www.orbeon.com/oxf/processors" >>>>> xmlns:xxforms="http://orbeon.org/oxf/xml/xforms" >>>>> xmlns:xs="http://www.w3.org/2001/XMLSchema" >>>>> xmlns:p="http://www.orbeon.com/oxf/pipeline" >>>>> xmlns:saxon="http://saxon.sf.net/" >>>>> xmlns:xforms="http://www.w3.org/2002/xforms" >>>>> xmlns:fn="http://www.w3.org/2005/02/xpath-functions"> >>>>> <stop-task> >>>>> <name>invpull-task</name> >>>>> </stop-task> >>>>> </config> >>>>> >>>>> ...and then turn it back on again with: >>>>> >>>>> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >>>>> xmlns:oxf="http://www.orbeon.com/oxf/processors" >>>>> xmlns:xxforms="http://orbeon.org/oxf/xml/xforms" >>>>> xmlns:xs="http://www.w3.org/2001/XMLSchema" >>>>> xmlns:p="http://www.orbeon.com/oxf/pipeline" >>>>> xmlns:saxon="http://saxon.sf.net/" >>>>> xmlns:xforms="http://www.w3.org/2002/xforms" >>>>> xmlns:fn="http://www.w3.org/2005/02/xpath-functions"> >>>>> <start-task> >>>>> <name>invpull-task</name> >>>>> <start-time>2006-02-28T09:13:00</start-time> >>>>> <interval>3600000</interval> >>>>> <processor-name>oxf:pipeline</processor-name> >>>>> <input name="config" >>>>> url="oxf:/convert/invpull-autorun.xpl"/> >>>>> </start-task> >>>>> </config> >>>>> >>>>> I see in the console the "invpull-task " to be run not once, but >>>>> several times with interval much shorter than 1 hour (which is the >>>>> value of the scheduled interval) which raises suspicion that the >>>>> previous tasks were not cleared when I stopped the execution. I did >>>>> try to restart tomcat, but that did not seem to have an effect. >>>>> >>>>> Also, right after I turn scheduler on, I see a bunch of lines shown >>>>> below which looks like some pending tasks to me. >>>>> >>>>> 2006-03-03 09:32:50,988 INFO >>>>> org.orbeon.oxf.processor.SchedulerProcessor null - /convert - >>>>> Received >>>>> request >>>>> 2006-03-03 09:32:50,995 INFO >>>>> org.orbeon.oxf.processor.SchedulerProcessor null - /convert - >>>>> Received >>>>> request >>>>> 2006-03-03 09:32:50,999 INFO >>>>> org.orbeon.oxf.processor.SchedulerProcessor null - /convert - >>>>> Received >>>>> request >>>>> >>>>> Lastly, I did a test where I set the the schedule start time to the >>>>> future, but just a minute or so after starting the scheduler, I see >>>>> in >>>>> the console the scheduled task being executed. >>>>> >>>>> A. >>>>> -- >>>>> You receive this message as a subscriber of the >>>>> [hidden email] mailing list. >>>>> To unsubscribe: mailto:[hidden email] >>>>> For general help: mailto:[hidden email]?subject=help >>>>> ObjectWeb mailing lists service home page: >>>>> http://www.objectweb.org/wws >>>> >>>> >>>> >>>> >>>> >>>> -- >>>> You receive this message as a subscriber of the >>>> [hidden email] mailing list. >>>> To unsubscribe: mailto:[hidden email] >>>> For general help: mailto:[hidden email]?subject=help >>>> ObjectWeb mailing lists service home page: >>>> http://www.objectweb.org/wws >>>> >>>> >>>> >>> >>> -- >>> Blog (XML, Web apps, Open Source): >>> http://www.orbeon.com/blog/ >>> >>> >>> -- >>> You receive this message as a subscriber of the >>> [hidden email] mailing list. >>> To unsubscribe: mailto:[hidden email] >>> For general help: mailto:[hidden email]?subject=help >>> ObjectWeb mailing lists service home page: >>> http://www.objectweb.org/wws >> >> >> >> >> >> -- >> You receive this message as a subscriber of the >> [hidden email] mailing list. >> To unsubscribe: mailto:[hidden email] >> For general help: mailto:[hidden email]?subject=help >> ObjectWeb mailing lists service home page: >> http://www.objectweb.org/wws >> >> >> > > -- > Blog (XML, Web apps, Open Source): > http://www.orbeon.com/blog/ > > > -- > You receive this message as a subscriber of the > [hidden email] mailing list. > To unsubscribe: mailto:[hidden email] > For general help: mailto:[hidden email]?subject=help > ObjectWeb mailing lists service home page: http://www.objectweb.org/wws -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Administrator
|
Alex,
The scheduler code uses java.util.Timer, which implements this "catch up" behavior. I can see reasons why they have implemented the code this way. For instance if you schedule a task every second, and at t=.5s there is big garbage collection that lasts for 1s, then your task will run as soon as possible after the garbage collection at t=1.5, and again at t=2s (instead of t=2.5). So their goal is that the average time between executions will be getting close to the interval you have specified over time. You can find the logic for this in Timer.mainLoop(). Since we don't want to change the logic in java.util.Timer, we could set the start time to "now" if the specified start time in the configuration in the past. I think we could even do this by default (no option), as I can't see a use case where you want to specify a time in the past and run the task x times immediately with x = (now - time specified)/interval. Opinions? Alex On 3/5/06, Alexander Zatko <[hidden email]> wrote: > Alex, > > I did some testing and I believe I figured out where the problem is. > > 1) When a start-time is supplied earlier than "now", the processor will > use the interval value to process all of the "missed" scheduling > events. > 2) simply switching the task off does not seem to clear the list of > missed events. After starting the same task again, the scheduler will > start processing the task even if the newly-supplied start-time is way > in the future. > > Maybe there are use cases where this behavior is the desired one, but > it is not the one I am trying to address. :-) > > To work around this I ensured that start-time is always "now", or in > the future, but maybe it would be worth considering to provide a new > parameter to allow user to specify whether missed events should be > processed, with the default set to "false"? > > If you want to play with this I have a simple test case that I can send > to you. > > A. > > On Mar 3, 2006, at 10:00 PM, Alessandro Vernet wrote: > > > Alex, > > > > Alright, then I'll wait for more information from you on this one. > > > > Alex > > > > On 3/3/06, Alexander Zatko <[hidden email]> wrote: > >> Alex, > >> > >> Not sure how to create a reproducible case for this. I will try to > >> deploy the app on a Windows machine first to see if that changes > >> anything. > >> > >> Thank you. > >> > >> A. > >> > >> > >> On Mar 3, 2006, at 3:39 PM, Alessandro Vernet wrote: > >> > >>> Alex, > >>> > >>> I tried to reproduce the problem, but stopping a scheduled task > >>> worked > >>> fine for me. In the examples, I modified > >>> context\context-initialized.xpl to run the task every 2 seconds with > >>> <interval>2000</interval>. Since there is a "debug" in > >>> oxf:/context/scheduled-task.xpl, when the task is running I see entry > >>> in the log every 2 seconds. > >>> > >>> I added to page-flow.xml this line: <page path-info="/stop" > >>> model="context/context-destroyed.xpl"/>. This will run > >>> context-destroyed.xpl which stops that task when the page /stop is > >>> loaded. As soon as I load /stop in the browser, I stop getting an > >>> entry in the log every 2 seconds, which shows that the task has been > >>> stopped. > >>> > >>> I think that to help further you would need to create for us a test > >>> case that we can run locally and that shows the issue. > >>> > >>> Alex > >>> > >>> On 3/3/06, Alexander Zatko <[hidden email]> wrote: > >>>> I set the value of the "synchronized" config element to "true" and > >>>> indeed - when trying to start the scheduler, I see line: > >>>> > >>>> 2006-03-03 09:58:00,012 INFO > >>>> org.orbeon.oxf.processor.SchedulerProcessor null - Task: > >>>> invpull-task > >>>> won't run since it is already running > >>>> > >>>> ... so I guess I am not succeeding stopping the task. Restarting > >>>> tomcat > >>>> does not help. > >>>> > >>>> A. > >>>> > >>>> On Mar 3, 2006, at 9:37 AM, Alexander Zatko wrote: > >>>> > >>>>> Is there any way to clear scheduler schedule "for sure"? When I > >>>>> "turn > >>>>> off" scheduler with: > >>>>> > >>>>> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > >>>>> xmlns:oxf="http://www.orbeon.com/oxf/processors" > >>>>> xmlns:xxforms="http://orbeon.org/oxf/xml/xforms" > >>>>> xmlns:xs="http://www.w3.org/2001/XMLSchema" > >>>>> xmlns:p="http://www.orbeon.com/oxf/pipeline" > >>>>> xmlns:saxon="http://saxon.sf.net/" > >>>>> xmlns:xforms="http://www.w3.org/2002/xforms" > >>>>> xmlns:fn="http://www.w3.org/2005/02/xpath-functions"> > >>>>> <stop-task> > >>>>> <name>invpull-task</name> > >>>>> </stop-task> > >>>>> </config> > >>>>> > >>>>> ...and then turn it back on again with: > >>>>> > >>>>> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > >>>>> xmlns:oxf="http://www.orbeon.com/oxf/processors" > >>>>> xmlns:xxforms="http://orbeon.org/oxf/xml/xforms" > >>>>> xmlns:xs="http://www.w3.org/2001/XMLSchema" > >>>>> xmlns:p="http://www.orbeon.com/oxf/pipeline" > >>>>> xmlns:saxon="http://saxon.sf.net/" > >>>>> xmlns:xforms="http://www.w3.org/2002/xforms" > >>>>> xmlns:fn="http://www.w3.org/2005/02/xpath-functions"> > >>>>> <start-task> > >>>>> <name>invpull-task</name> > >>>>> <start-time>2006-02-28T09:13:00</start-time> > >>>>> <interval>3600000</interval> > >>>>> <processor-name>oxf:pipeline</processor-name> > >>>>> <input name="config" > >>>>> url="oxf:/convert/invpull-autorun.xpl"/> > >>>>> </start-task> > >>>>> </config> > >>>>> > >>>>> I see in the console the "invpull-task " to be run not once, but > >>>>> several times with interval much shorter than 1 hour (which is the > >>>>> value of the scheduled interval) which raises suspicion that the > >>>>> previous tasks were not cleared when I stopped the execution. I did > >>>>> try to restart tomcat, but that did not seem to have an effect. > >>>>> > >>>>> Also, right after I turn scheduler on, I see a bunch of lines shown > >>>>> below which looks like some pending tasks to me. > >>>>> > >>>>> 2006-03-03 09:32:50,988 INFO > >>>>> org.orbeon.oxf.processor.SchedulerProcessor null - /convert - > >>>>> Received > >>>>> request > >>>>> 2006-03-03 09:32:50,995 INFO > >>>>> org.orbeon.oxf.processor.SchedulerProcessor null - /convert - > >>>>> Received > >>>>> request > >>>>> 2006-03-03 09:32:50,999 INFO > >>>>> org.orbeon.oxf.processor.SchedulerProcessor null - /convert - > >>>>> Received > >>>>> request > >>>>> > >>>>> Lastly, I did a test where I set the the schedule start time to the > >>>>> future, but just a minute or so after starting the scheduler, I see > >>>>> in > >>>>> the console the scheduled task being executed. > >>>>> > >>>>> A. > >>>>> -- > >>>>> You receive this message as a subscriber of the > >>>>> [hidden email] mailing list. > >>>>> To unsubscribe: mailto:[hidden email] > >>>>> For general help: mailto:[hidden email]?subject=help > >>>>> ObjectWeb mailing lists service home page: > >>>>> http://www.objectweb.org/wws > >>>> > >>>> > >>>> > >>>> > >>>> > >>>> -- > >>>> You receive this message as a subscriber of the > >>>> [hidden email] mailing list. > >>>> To unsubscribe: mailto:[hidden email] > >>>> For general help: mailto:[hidden email]?subject=help > >>>> ObjectWeb mailing lists service home page: > >>>> http://www.objectweb.org/wws > >>>> > >>>> > >>>> > >>> > >>> -- > >>> Blog (XML, Web apps, Open Source): > >>> http://www.orbeon.com/blog/ > >>> > >>> > >>> -- > >>> You receive this message as a subscriber of the > >>> [hidden email] mailing list. > >>> To unsubscribe: mailto:[hidden email] > >>> For general help: mailto:[hidden email]?subject=help > >>> ObjectWeb mailing lists service home page: > >>> http://www.objectweb.org/wws > >> > >> > >> > >> > >> > >> -- > >> You receive this message as a subscriber of the > >> [hidden email] mailing list. > >> To unsubscribe: mailto:[hidden email] > >> For general help: mailto:[hidden email]?subject=help > >> ObjectWeb mailing lists service home page: > >> http://www.objectweb.org/wws > >> > >> > >> > > > > -- > > Blog (XML, Web apps, Open Source): > > http://www.orbeon.com/blog/ > > > > > > -- > > You receive this message as a subscriber of the > > [hidden email] mailing list. > > To unsubscribe: mailto:[hidden email] > > For general help: mailto:[hidden email]?subject=help > > ObjectWeb mailing lists service home page: http://www.objectweb.org/wws > > > > > > -- > You receive this message as a subscriber of the [hidden email] mailing list. > To unsubscribe: mailto:[hidden email] > For general help: mailto:[hidden email]?subject=help > ObjectWeb mailing lists service home page: http://www.objectweb.org/wws > > > -- Blog (XML, Web apps, Open Source): http://www.orbeon.com/blog/ -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
--
Follow Orbeon on Twitter: @orbeon Follow me on Twitter: @avernet |
Alex,
My vote is for your proposal as that is exactly what I implemented using "XML-level" conditional constructs. A. On Mar 7, 2006, at 6:15 PM, Alessandro Vernet wrote: > Alex, > > The scheduler code uses java.util.Timer, which implements this "catch > up" behavior. I can see reasons why they have implemented the code > this way. For instance if you schedule a task every second, and at > t=.5s there is big garbage collection that lasts for 1s, then your > task will run as soon as possible after the garbage collection at > t=1.5, and again at t=2s (instead of t=2.5). So their goal is that the > average time between executions will be getting close to the interval > you have specified over time. You can find the logic for this in > Timer.mainLoop(). > > Since we don't want to change the logic in java.util.Timer, we could > set the start time to "now" if the specified start time in the > configuration in the past. I think we could even do this by default > (no option), as I can't see a use case where you want to specify a > time in the past and run the task x times immediately with x = (now - > time specified)/interval. > > Opinions? > > Alex > > On 3/5/06, Alexander Zatko <[hidden email]> wrote: >> Alex, >> >> I did some testing and I believe I figured out where the problem is. >> >> 1) When a start-time is supplied earlier than "now", the processor >> will >> use the interval value to process all of the "missed" scheduling >> events. >> 2) simply switching the task off does not seem to clear the list of >> missed events. After starting the same task again, the scheduler will >> start processing the task even if the newly-supplied start-time is way >> in the future. >> >> Maybe there are use cases where this behavior is the desired one, but >> it is not the one I am trying to address. :-) >> >> To work around this I ensured that start-time is always "now", or in >> the future, but maybe it would be worth considering to provide a new >> parameter to allow user to specify whether missed events should be >> processed, with the default set to "false"? >> >> If you want to play with this I have a simple test case that I can >> send >> to you. >> >> A. >> >> On Mar 3, 2006, at 10:00 PM, Alessandro Vernet wrote: >> >>> Alex, >>> >>> Alright, then I'll wait for more information from you on this one. >>> >>> Alex >>> >>> On 3/3/06, Alexander Zatko <[hidden email]> wrote: >>>> Alex, >>>> >>>> Not sure how to create a reproducible case for this. I will try to >>>> deploy the app on a Windows machine first to see if that changes >>>> anything. >>>> >>>> Thank you. >>>> >>>> A. >>>> >>>> >>>> On Mar 3, 2006, at 3:39 PM, Alessandro Vernet wrote: >>>> >>>>> Alex, >>>>> >>>>> I tried to reproduce the problem, but stopping a scheduled task >>>>> worked >>>>> fine for me. In the examples, I modified >>>>> context\context-initialized.xpl to run the task every 2 seconds >>>>> with >>>>> <interval>2000</interval>. Since there is a "debug" in >>>>> oxf:/context/scheduled-task.xpl, when the task is running I see >>>>> entry >>>>> in the log every 2 seconds. >>>>> >>>>> I added to page-flow.xml this line: <page path-info="/stop" >>>>> model="context/context-destroyed.xpl"/>. This will run >>>>> context-destroyed.xpl which stops that task when the page /stop is >>>>> loaded. As soon as I load /stop in the browser, I stop getting an >>>>> entry in the log every 2 seconds, which shows that the task has >>>>> been >>>>> stopped. >>>>> >>>>> I think that to help further you would need to create for us a test >>>>> case that we can run locally and that shows the issue. >>>>> >>>>> Alex >>>>> >>>>> On 3/3/06, Alexander Zatko <[hidden email]> wrote: >>>>>> I set the value of the "synchronized" config element to "true" and >>>>>> indeed - when trying to start the scheduler, I see line: >>>>>> >>>>>> 2006-03-03 09:58:00,012 INFO >>>>>> org.orbeon.oxf.processor.SchedulerProcessor null - Task: >>>>>> invpull-task >>>>>> won't run since it is already running >>>>>> >>>>>> ... so I guess I am not succeeding stopping the task. Restarting >>>>>> tomcat >>>>>> does not help. >>>>>> >>>>>> A. >>>>>> >>>>>> On Mar 3, 2006, at 9:37 AM, Alexander Zatko wrote: >>>>>> >>>>>>> Is there any way to clear scheduler schedule "for sure"? When I >>>>>>> "turn >>>>>>> off" scheduler with: >>>>>>> >>>>>>> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >>>>>>> xmlns:oxf="http://www.orbeon.com/oxf/processors" >>>>>>> xmlns:xxforms="http://orbeon.org/oxf/xml/xforms" >>>>>>> xmlns:xs="http://www.w3.org/2001/XMLSchema" >>>>>>> xmlns:p="http://www.orbeon.com/oxf/pipeline" >>>>>>> xmlns:saxon="http://saxon.sf.net/" >>>>>>> xmlns:xforms="http://www.w3.org/2002/xforms" >>>>>>> xmlns:fn="http://www.w3.org/2005/02/xpath-functions"> >>>>>>> <stop-task> >>>>>>> <name>invpull-task</name> >>>>>>> </stop-task> >>>>>>> </config> >>>>>>> >>>>>>> ...and then turn it back on again with: >>>>>>> >>>>>>> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >>>>>>> xmlns:oxf="http://www.orbeon.com/oxf/processors" >>>>>>> xmlns:xxforms="http://orbeon.org/oxf/xml/xforms" >>>>>>> xmlns:xs="http://www.w3.org/2001/XMLSchema" >>>>>>> xmlns:p="http://www.orbeon.com/oxf/pipeline" >>>>>>> xmlns:saxon="http://saxon.sf.net/" >>>>>>> xmlns:xforms="http://www.w3.org/2002/xforms" >>>>>>> xmlns:fn="http://www.w3.org/2005/02/xpath-functions"> >>>>>>> <start-task> >>>>>>> <name>invpull-task</name> >>>>>>> <start-time>2006-02-28T09:13:00</start-time> >>>>>>> <interval>3600000</interval> >>>>>>> <processor-name>oxf:pipeline</processor-name> >>>>>>> <input name="config" >>>>>>> url="oxf:/convert/invpull-autorun.xpl"/> >>>>>>> </start-task> >>>>>>> </config> >>>>>>> >>>>>>> I see in the console the "invpull-task " to be run not once, but >>>>>>> several times with interval much shorter than 1 hour (which is >>>>>>> the >>>>>>> value of the scheduled interval) which raises suspicion that the >>>>>>> previous tasks were not cleared when I stopped the execution. I >>>>>>> did >>>>>>> try to restart tomcat, but that did not seem to have an effect. >>>>>>> >>>>>>> Also, right after I turn scheduler on, I see a bunch of lines >>>>>>> shown >>>>>>> below which looks like some pending tasks to me. >>>>>>> >>>>>>> 2006-03-03 09:32:50,988 INFO >>>>>>> org.orbeon.oxf.processor.SchedulerProcessor null - /convert - >>>>>>> Received >>>>>>> request >>>>>>> 2006-03-03 09:32:50,995 INFO >>>>>>> org.orbeon.oxf.processor.SchedulerProcessor null - /convert - >>>>>>> Received >>>>>>> request >>>>>>> 2006-03-03 09:32:50,999 INFO >>>>>>> org.orbeon.oxf.processor.SchedulerProcessor null - /convert - >>>>>>> Received >>>>>>> request >>>>>>> >>>>>>> Lastly, I did a test where I set the the schedule start time to >>>>>>> the >>>>>>> future, but just a minute or so after starting the scheduler, I >>>>>>> see >>>>>>> in >>>>>>> the console the scheduled task being executed. >>>>>>> >>>>>>> A. >>>>>>> -- >>>>>>> You receive this message as a subscriber of the >>>>>>> [hidden email] mailing list. >>>>>>> To unsubscribe: mailto:[hidden email] >>>>>>> For general help: mailto:[hidden email]?subject=help >>>>>>> ObjectWeb mailing lists service home page: >>>>>>> http://www.objectweb.org/wws >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> You receive this message as a subscriber of the >>>>>> [hidden email] mailing list. >>>>>> To unsubscribe: mailto:[hidden email] >>>>>> For general help: mailto:[hidden email]?subject=help >>>>>> ObjectWeb mailing lists service home page: >>>>>> http://www.objectweb.org/wws >>>>>> >>>>>> >>>>>> >>>>> >>>>> -- >>>>> Blog (XML, Web apps, Open Source): >>>>> http://www.orbeon.com/blog/ >>>>> >>>>> >>>>> -- >>>>> You receive this message as a subscriber of the >>>>> [hidden email] mailing list. >>>>> To unsubscribe: mailto:[hidden email] >>>>> For general help: mailto:[hidden email]?subject=help >>>>> ObjectWeb mailing lists service home page: >>>>> http://www.objectweb.org/wws >>>> >>>> >>>> >>>> >>>> >>>> -- >>>> You receive this message as a subscriber of the >>>> [hidden email] mailing list. >>>> To unsubscribe: mailto:[hidden email] >>>> For general help: mailto:[hidden email]?subject=help >>>> ObjectWeb mailing lists service home page: >>>> http://www.objectweb.org/wws >>>> >>>> >>>> >>> >>> -- >>> Blog (XML, Web apps, Open Source): >>> http://www.orbeon.com/blog/ >>> >>> >>> -- >>> You receive this message as a subscriber of the >>> [hidden email] mailing list. >>> To unsubscribe: mailto:[hidden email] >>> For general help: mailto:[hidden email]?subject=help >>> ObjectWeb mailing lists service home page: >>> http://www.objectweb.org/wws >> >> >> >> >> >> -- >> You receive this message as a subscriber of the >> [hidden email] mailing list. >> To unsubscribe: mailto:[hidden email] >> For general help: mailto:[hidden email]?subject=help >> ObjectWeb mailing lists service home page: >> http://www.objectweb.org/wws >> >> >> > > -- > Blog (XML, Web apps, Open Source): > http://www.orbeon.com/blog/ > > > -- > You receive this message as a subscriber of the > [hidden email] mailing list. > To unsubscribe: mailto:[hidden email] > For general help: mailto:[hidden email]?subject=help > ObjectWeb mailing lists service home page: http://www.objectweb.org/wws -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Administrator
|
Alex,
Alright, then I have created an entry in the tracker to keep track of this improvement. If you or anyone else wants to implement this and submit a patch for this, we'll be happy to check it in. http://forge.objectweb.org/tracker/index.php?func=detail&aid=304763&group_id=168&atid=350207 Alex On 3/7/06, Alexander Zatko <[hidden email]> wrote: > Alex, > > My vote is for your proposal as that is exactly what I implemented > using "XML-level" conditional constructs. > > A. > > > On Mar 7, 2006, at 6:15 PM, Alessandro Vernet wrote: > > > Alex, > > > > The scheduler code uses java.util.Timer, which implements this "catch > > up" behavior. I can see reasons why they have implemented the code > > this way. For instance if you schedule a task every second, and at > > t=.5s there is big garbage collection that lasts for 1s, then your > > task will run as soon as possible after the garbage collection at > > t=1.5, and again at t=2s (instead of t=2.5). So their goal is that the > > average time between executions will be getting close to the interval > > you have specified over time. You can find the logic for this in > > Timer.mainLoop(). > > > > Since we don't want to change the logic in java.util.Timer, we could > > set the start time to "now" if the specified start time in the > > configuration in the past. I think we could even do this by default > > (no option), as I can't see a use case where you want to specify a > > time in the past and run the task x times immediately with x = (now - > > time specified)/interval. > > > > Opinions? > > > > Alex > > > > On 3/5/06, Alexander Zatko <[hidden email]> wrote: > >> Alex, > >> > >> I did some testing and I believe I figured out where the problem is. > >> > >> 1) When a start-time is supplied earlier than "now", the processor > >> will > >> use the interval value to process all of the "missed" scheduling > >> events. > >> 2) simply switching the task off does not seem to clear the list of > >> missed events. After starting the same task again, the scheduler will > >> start processing the task even if the newly-supplied start-time is way > >> in the future. > >> > >> Maybe there are use cases where this behavior is the desired one, but > >> it is not the one I am trying to address. :-) > >> > >> To work around this I ensured that start-time is always "now", or in > >> the future, but maybe it would be worth considering to provide a new > >> parameter to allow user to specify whether missed events should be > >> processed, with the default set to "false"? > >> > >> If you want to play with this I have a simple test case that I can > >> send > >> to you. > >> > >> A. > >> > >> On Mar 3, 2006, at 10:00 PM, Alessandro Vernet wrote: > >> > >>> Alex, > >>> > >>> Alright, then I'll wait for more information from you on this one. > >>> > >>> Alex > >>> > >>> On 3/3/06, Alexander Zatko <[hidden email]> wrote: > >>>> Alex, > >>>> > >>>> Not sure how to create a reproducible case for this. I will try to > >>>> deploy the app on a Windows machine first to see if that changes > >>>> anything. > >>>> > >>>> Thank you. > >>>> > >>>> A. > >>>> > >>>> > >>>> On Mar 3, 2006, at 3:39 PM, Alessandro Vernet wrote: > >>>> > >>>>> Alex, > >>>>> > >>>>> I tried to reproduce the problem, but stopping a scheduled task > >>>>> worked > >>>>> fine for me. In the examples, I modified > >>>>> context\context-initialized.xpl to run the task every 2 seconds > >>>>> with > >>>>> <interval>2000</interval>. Since there is a "debug" in > >>>>> oxf:/context/scheduled-task.xpl, when the task is running I see > >>>>> entry > >>>>> in the log every 2 seconds. > >>>>> > >>>>> I added to page-flow.xml this line: <page path-info="/stop" > >>>>> model="context/context-destroyed.xpl"/>. This will run > >>>>> context-destroyed.xpl which stops that task when the page /stop is > >>>>> loaded. As soon as I load /stop in the browser, I stop getting an > >>>>> entry in the log every 2 seconds, which shows that the task has > >>>>> been > >>>>> stopped. > >>>>> > >>>>> I think that to help further you would need to create for us a test > >>>>> case that we can run locally and that shows the issue. > >>>>> > >>>>> Alex > >>>>> > >>>>> On 3/3/06, Alexander Zatko <[hidden email]> wrote: > >>>>>> I set the value of the "synchronized" config element to "true" and > >>>>>> indeed - when trying to start the scheduler, I see line: > >>>>>> > >>>>>> 2006-03-03 09:58:00,012 INFO > >>>>>> org.orbeon.oxf.processor.SchedulerProcessor null - Task: > >>>>>> invpull-task > >>>>>> won't run since it is already running > >>>>>> > >>>>>> ... so I guess I am not succeeding stopping the task. Restarting > >>>>>> tomcat > >>>>>> does not help. > >>>>>> > >>>>>> A. > >>>>>> > >>>>>> On Mar 3, 2006, at 9:37 AM, Alexander Zatko wrote: > >>>>>> > >>>>>>> Is there any way to clear scheduler schedule "for sure"? When I > >>>>>>> "turn > >>>>>>> off" scheduler with: > >>>>>>> > >>>>>>> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > >>>>>>> xmlns:oxf="http://www.orbeon.com/oxf/processors" > >>>>>>> xmlns:xxforms="http://orbeon.org/oxf/xml/xforms" > >>>>>>> xmlns:xs="http://www.w3.org/2001/XMLSchema" > >>>>>>> xmlns:p="http://www.orbeon.com/oxf/pipeline" > >>>>>>> xmlns:saxon="http://saxon.sf.net/" > >>>>>>> xmlns:xforms="http://www.w3.org/2002/xforms" > >>>>>>> xmlns:fn="http://www.w3.org/2005/02/xpath-functions"> > >>>>>>> <stop-task> > >>>>>>> <name>invpull-task</name> > >>>>>>> </stop-task> > >>>>>>> </config> > >>>>>>> > >>>>>>> ...and then turn it back on again with: > >>>>>>> > >>>>>>> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > >>>>>>> xmlns:oxf="http://www.orbeon.com/oxf/processors" > >>>>>>> xmlns:xxforms="http://orbeon.org/oxf/xml/xforms" > >>>>>>> xmlns:xs="http://www.w3.org/2001/XMLSchema" > >>>>>>> xmlns:p="http://www.orbeon.com/oxf/pipeline" > >>>>>>> xmlns:saxon="http://saxon.sf.net/" > >>>>>>> xmlns:xforms="http://www.w3.org/2002/xforms" > >>>>>>> xmlns:fn="http://www.w3.org/2005/02/xpath-functions"> > >>>>>>> <start-task> > >>>>>>> <name>invpull-task</name> > >>>>>>> <start-time>2006-02-28T09:13:00</start-time> > >>>>>>> <interval>3600000</interval> > >>>>>>> <processor-name>oxf:pipeline</processor-name> > >>>>>>> <input name="config" > >>>>>>> url="oxf:/convert/invpull-autorun.xpl"/> > >>>>>>> </start-task> > >>>>>>> </config> > >>>>>>> > >>>>>>> I see in the console the "invpull-task " to be run not once, but > >>>>>>> several times with interval much shorter than 1 hour (which is > >>>>>>> the > >>>>>>> value of the scheduled interval) which raises suspicion that the > >>>>>>> previous tasks were not cleared when I stopped the execution. I > >>>>>>> did > >>>>>>> try to restart tomcat, but that did not seem to have an effect. > >>>>>>> > >>>>>>> Also, right after I turn scheduler on, I see a bunch of lines > >>>>>>> shown > >>>>>>> below which looks like some pending tasks to me. > >>>>>>> > >>>>>>> 2006-03-03 09:32:50,988 INFO > >>>>>>> org.orbeon.oxf.processor.SchedulerProcessor null - /convert - > >>>>>>> Received > >>>>>>> request > >>>>>>> 2006-03-03 09:32:50,995 INFO > >>>>>>> org.orbeon.oxf.processor.SchedulerProcessor null - /convert - > >>>>>>> Received > >>>>>>> request > >>>>>>> 2006-03-03 09:32:50,999 INFO > >>>>>>> org.orbeon.oxf.processor.SchedulerProcessor null - /convert - > >>>>>>> Received > >>>>>>> request > >>>>>>> > >>>>>>> Lastly, I did a test where I set the the schedule start time to > >>>>>>> the > >>>>>>> future, but just a minute or so after starting the scheduler, I > >>>>>>> see > >>>>>>> in > >>>>>>> the console the scheduled task being executed. > >>>>>>> > >>>>>>> A. > >>>>>>> -- > >>>>>>> You receive this message as a subscriber of the > >>>>>>> [hidden email] mailing list. > >>>>>>> To unsubscribe: mailto:[hidden email] > >>>>>>> For general help: mailto:[hidden email]?subject=help > >>>>>>> ObjectWeb mailing lists service home page: > >>>>>>> http://www.objectweb.org/wws > >>>>>> > >>>>>> > >>>>>> > >>>>>> > >>>>>> > >>>>>> -- > >>>>>> You receive this message as a subscriber of the > >>>>>> [hidden email] mailing list. > >>>>>> To unsubscribe: mailto:[hidden email] > >>>>>> For general help: mailto:[hidden email]?subject=help > >>>>>> ObjectWeb mailing lists service home page: > >>>>>> http://www.objectweb.org/wws > >>>>>> > >>>>>> > >>>>>> > >>>>> > >>>>> -- > >>>>> Blog (XML, Web apps, Open Source): > >>>>> http://www.orbeon.com/blog/ > >>>>> > >>>>> > >>>>> -- > >>>>> You receive this message as a subscriber of the > >>>>> [hidden email] mailing list. > >>>>> To unsubscribe: mailto:[hidden email] > >>>>> For general help: mailto:[hidden email]?subject=help > >>>>> ObjectWeb mailing lists service home page: > >>>>> http://www.objectweb.org/wws > >>>> > >>>> > >>>> > >>>> > >>>> > >>>> -- > >>>> You receive this message as a subscriber of the > >>>> [hidden email] mailing list. > >>>> To unsubscribe: mailto:[hidden email] > >>>> For general help: mailto:[hidden email]?subject=help > >>>> ObjectWeb mailing lists service home page: > >>>> http://www.objectweb.org/wws > >>>> > >>>> > >>>> > >>> > >>> -- > >>> Blog (XML, Web apps, Open Source): > >>> http://www.orbeon.com/blog/ > >>> > >>> > >>> -- > >>> You receive this message as a subscriber of the > >>> [hidden email] mailing list. > >>> To unsubscribe: mailto:[hidden email] > >>> For general help: mailto:[hidden email]?subject=help > >>> ObjectWeb mailing lists service home page: > >>> http://www.objectweb.org/wws > >> > >> > >> > >> > >> > >> -- > >> You receive this message as a subscriber of the > >> [hidden email] mailing list. > >> To unsubscribe: mailto:[hidden email] > >> For general help: mailto:[hidden email]?subject=help > >> ObjectWeb mailing lists service home page: > >> http://www.objectweb.org/wws > >> > >> > >> > > > > -- > > Blog (XML, Web apps, Open Source): > > http://www.orbeon.com/blog/ > > > > > > -- > > You receive this message as a subscriber of the > > [hidden email] mailing list. > > To unsubscribe: mailto:[hidden email] > > For general help: mailto:[hidden email]?subject=help > > ObjectWeb mailing lists service home page: http://www.objectweb.org/wws > > > > > > -- > You receive this message as a subscriber of the [hidden email] mailing list. > To unsubscribe: mailto:[hidden email] > For general help: mailto:[hidden email]?subject=help > ObjectWeb mailing lists service home page: http://www.objectweb.org/wws > > > -- Blog (XML, Web apps, Open Source): http://www.orbeon.com/blog/ -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
--
Follow Orbeon on Twitter: @orbeon Follow me on Twitter: @avernet |
Free forum by Nabble | Edit this page |