camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nurali (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (CAMEL-6832) Memory leak - when an exception is thrown during the scheduling phase
Date Mon, 07 Oct 2013 03:03:41 GMT

     [ https://issues.apache.org/jira/browse/CAMEL-6832?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Nurali updated CAMEL-6832:
--------------------------

    Description: 
Hello,

I have observed a memory leak for Quartz worker thread in case an exception is thrown during
the scheduling phase when schedule is set to past time.
I have observed this issue with camel-quart 2.10.4, 2.11.0, 2.11.2 versions.

For ex, assuming today is 4-Oct; If a schedule is provided for yesterday (i.e 3-Oct) then
below sequence happen:

1. Quartz create worker thread for new schedule [generally TEN Threads with name 'DefaultQuartzScheduler']
2. Camel-quartz increment jobCounter for scheduler context [using QuartzComponent.incrementJobCounter()]
3. Camel-quartz tries to create new schedule [using Scheduler.scheduleJob()]
4. scheduleJob() throws SchedulerException with the message - 'Based on configured schedule,
the given trigger will never fire'
5. Camel-quartz does NOT decrement the job counter and jobCounter value remains '1'
6. Later Camel-Quartz stops the route and call QuartzComponent.doStop()
7. In doStop(), Scheduler.shutdown() supposed to be called so that those TEN threads are
removed but to call shutdown() the pre-condition is that the jobCounter should be '0'.  In
this case jobCounter is '1' and Scheduler.shutdown() will NOT be called and those TEN threads
are NOT removed.  This is memory leak.

Please find the stack trace in attachment 'memory_leak_scheduler_stack_trace.log' [with Camel-Quartz
2.11.2 and org.apache.servicemix.bundles.quartz-1.8.6_1
which wrapped Quartz Scheduler as OSGi bundle] when SchedulerException is thrown at step
4 in above sequence.

Thanks,
Nurali

  was:
Hello,

I have observed a memory leak for Quartz worker thread in case an exception is thrown during
the scheduling phase when schedule is set to past time.
I have observed this issue with camel-quart 2.10.4, 2.11.0, 2.11.2 versions.

For ex, assuming today is 4-Oct; If a schedule is provided for yesterday (i.e 3-Oct) then
below sequence happen:

1. Quartz create worker thread for new schedule [generally TEN Threads with name 'DefaultQuartzScheduler']
2. Camel-quartz increment jobCounter for scheduler context [using QuartzComponent.incrementJobCounter()]
3. Camel-quartz tries to create new schedule [using Scheduler.scheduleJob()]
4. scheduleJob() throws SchedulerException with the message - 'Based on configured schedule,
the given trigger will never fire'
5. Camel-quartz does NOT decrement the job counter and jobCounter value remains '1'
6. Later Camel-Quartz stops the route and call QuartzComponent.doStop()
7. In doStop(), Scheduler.shutdown() supposed to be called so that those TEN threads are
removed but to call shutdown() the pre-condition is that the jobCounter should be '0'.  In
this case jobCounter is '1' and Scheduler.shutdown() will NOT be called and those TEN threads
are NOT removed.  This is memory leak.

Please find the stack trace [with Camel-Quartz 2.11.2 and org.apache.servicemix.bundles.quartz-1.8.6_1
which wrapped Quartz Scheduler as OSGi bundle] when SchedulerException is thrown at step
4 in above sequence.

Thanks,
Nurali


> Memory leak - when an exception is thrown during the scheduling phase
> ---------------------------------------------------------------------
>
>                 Key: CAMEL-6832
>                 URL: https://issues.apache.org/jira/browse/CAMEL-6832
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-quartz
>    Affects Versions: 2.10.4, 2.11.0, 2.11.2
>         Environment: OS - Windows 7 and Unix.  Server – OSGi equinox
>            Reporter: Nurali
>              Labels: quartz, scheduler
>         Attachments: memory_leak_scheduler_stack_trace.log
>
>
> Hello,
> I have observed a memory leak for Quartz worker thread in case an exception is thrown
during
> the scheduling phase when schedule is set to past time.
> I have observed this issue with camel-quart 2.10.4, 2.11.0, 2.11.2 versions.
> For ex, assuming today is 4-Oct; If a schedule is provided for yesterday (i.e 3-Oct)
then
> below sequence happen:
> 1. Quartz create worker thread for new schedule [generally TEN Threads with name 'DefaultQuartzScheduler']
> 2. Camel-quartz increment jobCounter for scheduler context [using QuartzComponent.incrementJobCounter()]
> 3. Camel-quartz tries to create new schedule [using Scheduler.scheduleJob()]
> 4. scheduleJob() throws SchedulerException with the message - 'Based on configured schedule,
> the given trigger will never fire'
> 5. Camel-quartz does NOT decrement the job counter and jobCounter value remains '1'
> 6. Later Camel-Quartz stops the route and call QuartzComponent.doStop()
> 7. In doStop(), Scheduler.shutdown() supposed to be called so that those TEN threads
are
> removed but to call shutdown() the pre-condition is that the jobCounter should be '0'.
 In
> this case jobCounter is '1' and Scheduler.shutdown() will NOT be called and those TEN
threads
> are NOT removed.  This is memory leak.
> Please find the stack trace in attachment 'memory_leak_scheduler_stack_trace.log' [with
Camel-Quartz 2.11.2 and org.apache.servicemix.bundles.quartz-1.8.6_1
> which wrapped Quartz Scheduler as OSGi bundle] when SchedulerException is thrown at step
> 4 in above sequence.
> Thanks,
> Nurali



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Mime
View raw message