You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@deltaspike.apache.org by Gary Hodgson <ga...@gmail.com> on 2019/11/07 21:28:25 UTC

Potential discrepancy in AbstractQuartzScheduler.stop of Scheduler Module

Hi

I believe I may have found a discrepancy in the AbstractQuartzScheduler
class of the Scheduler Module.

The stop method calls the shutdown method of the Quartz scheduler with the
base config of "deltaspike.scheduler.force_stop":


this.scheduler.shutdown(SchedulerBaseConfig.LifecycleIntegration.FORCE_STOP);

  (
https://github.com/apache/deltaspike/blob/master/deltaspike/modules/scheduler/impl/src/main/java/org/apache/deltaspike/scheduler/impl/AbstractQuartzScheduler.java#L161
)


However the parameter is called waitForJobsToComplete

     * @param waitForJobsToComplete
     *          if <code>true</code> the scheduler will not allow this
method
     *          to return until all currently executing jobs have completed.

which means the config actually does the opposite of what it intends, i.e.
deltaspike.scheduler.force_stop=true would actually wait for the executing
jobs to complete rather than stopping immediately.

I presume this would be fixed by negating the parameter:


this.scheduler.shutdown(!SchedulerBaseConfig.LifecycleIntegration.FORCE_STOP);



Best Regards,
Gary

Re: Potential discrepancy in AbstractQuartzScheduler.stop of Scheduler Module

Posted by Mark Struberg <st...@yahoo.de.INVALID>.
And here we have it fixed ;)

Thanks for the report and hints how to fix it!

LieGrue,
strub

> Am 07.11.2019 um 23:30 schrieb Gary Hodgson <ga...@gmail.com>:
> 
> Hi Thomas,
> 
> Here you go:
> https://issues.apache.org/jira/browse/DELTASPIKE-1396
> https://github.com/apache/deltaspike/pull/99
> 
> Best regards,
> Gary
> 
> On Thu, 7 Nov 2019 at 22:52, Thomas Andraschko <an...@gmail.com>
> wrote:
> 
>> Hi,
>> 
>> Feel free to create a issue and provide a Patch / pull request.
>> 
>> Best regards,
>> Thomas
>> 
>> Gary Hodgson <ga...@gmail.com> schrieb am Do., 7. Nov. 2019,
>> 22:29:
>> 
>>> Hi
>>> 
>>> I believe I may have found a discrepancy in the AbstractQuartzScheduler
>>> class of the Scheduler Module.
>>> 
>>> The stop method calls the shutdown method of the Quartz scheduler with
>> the
>>> base config of "deltaspike.scheduler.force_stop":
>>> 
>>> 
>>> 
>>> 
>> this.scheduler.shutdown(SchedulerBaseConfig.LifecycleIntegration.FORCE_STOP);
>>> 
>>>  (
>>> 
>>> 
>> https://github.com/apache/deltaspike/blob/master/deltaspike/modules/scheduler/impl/src/main/java/org/apache/deltaspike/scheduler/impl/AbstractQuartzScheduler.java#L161
>>> )
>>> 
>>> 
>>> However the parameter is called waitForJobsToComplete
>>> 
>>>     * @param waitForJobsToComplete
>>>     *          if <code>true</code> the scheduler will not allow this
>>> method
>>>     *          to return until all currently executing jobs have
>>> completed.
>>> 
>>> which means the config actually does the opposite of what it intends,
>> i.e.
>>> deltaspike.scheduler.force_stop=true would actually wait for the
>> executing
>>> jobs to complete rather than stopping immediately.
>>> 
>>> I presume this would be fixed by negating the parameter:
>>> 
>>> 
>>> 
>>> 
>> this.scheduler.shutdown(!SchedulerBaseConfig.LifecycleIntegration.FORCE_STOP);
>>> 
>>> 
>>> 
>>> Best Regards,
>>> Gary
>>> 
>> 


Re: Potential discrepancy in AbstractQuartzScheduler.stop of Scheduler Module

Posted by Gary Hodgson <ga...@gmail.com>.
Hi Thomas,

Here you go:
https://issues.apache.org/jira/browse/DELTASPIKE-1396
https://github.com/apache/deltaspike/pull/99

Best regards,
Gary

On Thu, 7 Nov 2019 at 22:52, Thomas Andraschko <an...@gmail.com>
wrote:

> Hi,
>
> Feel free to create a issue and provide a Patch / pull request.
>
> Best regards,
> Thomas
>
> Gary Hodgson <ga...@gmail.com> schrieb am Do., 7. Nov. 2019,
> 22:29:
>
> > Hi
> >
> > I believe I may have found a discrepancy in the AbstractQuartzScheduler
> > class of the Scheduler Module.
> >
> > The stop method calls the shutdown method of the Quartz scheduler with
> the
> > base config of "deltaspike.scheduler.force_stop":
> >
> >
> >
> >
> this.scheduler.shutdown(SchedulerBaseConfig.LifecycleIntegration.FORCE_STOP);
> >
> >   (
> >
> >
> https://github.com/apache/deltaspike/blob/master/deltaspike/modules/scheduler/impl/src/main/java/org/apache/deltaspike/scheduler/impl/AbstractQuartzScheduler.java#L161
> > )
> >
> >
> > However the parameter is called waitForJobsToComplete
> >
> >      * @param waitForJobsToComplete
> >      *          if <code>true</code> the scheduler will not allow this
> > method
> >      *          to return until all currently executing jobs have
> > completed.
> >
> > which means the config actually does the opposite of what it intends,
> i.e.
> > deltaspike.scheduler.force_stop=true would actually wait for the
> executing
> > jobs to complete rather than stopping immediately.
> >
> > I presume this would be fixed by negating the parameter:
> >
> >
> >
> >
> this.scheduler.shutdown(!SchedulerBaseConfig.LifecycleIntegration.FORCE_STOP);
> >
> >
> >
> > Best Regards,
> > Gary
> >
>

Re: Potential discrepancy in AbstractQuartzScheduler.stop of Scheduler Module

Posted by Thomas Andraschko <an...@gmail.com>.
Hi,

Feel free to create a issue and provide a Patch / pull request.

Best regards,
Thomas

Gary Hodgson <ga...@gmail.com> schrieb am Do., 7. Nov. 2019, 22:29:

> Hi
>
> I believe I may have found a discrepancy in the AbstractQuartzScheduler
> class of the Scheduler Module.
>
> The stop method calls the shutdown method of the Quartz scheduler with the
> base config of "deltaspike.scheduler.force_stop":
>
>
>
> this.scheduler.shutdown(SchedulerBaseConfig.LifecycleIntegration.FORCE_STOP);
>
>   (
>
> https://github.com/apache/deltaspike/blob/master/deltaspike/modules/scheduler/impl/src/main/java/org/apache/deltaspike/scheduler/impl/AbstractQuartzScheduler.java#L161
> )
>
>
> However the parameter is called waitForJobsToComplete
>
>      * @param waitForJobsToComplete
>      *          if <code>true</code> the scheduler will not allow this
> method
>      *          to return until all currently executing jobs have
> completed.
>
> which means the config actually does the opposite of what it intends, i.e.
> deltaspike.scheduler.force_stop=true would actually wait for the executing
> jobs to complete rather than stopping immediately.
>
> I presume this would be fixed by negating the parameter:
>
>
>
> this.scheduler.shutdown(!SchedulerBaseConfig.LifecycleIntegration.FORCE_STOP);
>
>
>
> Best Regards,
> Gary
>