History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: QUARTZ-450
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: James House
Reporter: Sanjay Prasad
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Quartz Scheduler

Thread groups created by quarts are not cleaned up

Created: 18/May/06 08:45 PM   Updated: 24/Dec/07 01:30 AM
Component/s: None
Affects Version/s: 1.5.2
Fix Version/s: 1.6

Environment: Linux, java 1.5
Issue Links:
Related
This issue relates to:
QUARTZ-204 Need to daemonize scheduler thread, c... Major Closed
 

Flags: Patch


 Description  « Hide
We are having ear re-deploment problems under Jboss and found that the thread groups created by quarts were not getting cleanup. (Don't ask me why, the groups hang in there even after a re-deployment). If the thread groups are made daemons they will get auto destroyed when the last thread exists. Here is the modified function from QuartzScheduler.java (this thing works and the groups are cleaned up)

public ThreadGroup getSchedulerThreadGroup() {
        if (threadGroup == null) {
            threadGroup = new ThreadGroup("QuartzScheduler:"
                    + getSchedulerName());
            threadGroup.setDaemon(true);
        }

return threadGroup;
    }


 All   Comments   Change History      Sort Order:
James House - [18/May/06 10:54 PM ]


We've actually already done similar work, and more (see linked issue).

Thanks for contributing though, we do appreciate users who do so!


Sanjay Prasad - [19/May/06 12:10 PM ]
The duplicate issue seems to be about daemon threads not about daemon thread groups. The thread groups are not marked daemon nor are they destroyed. I think the this issue is different from the duplicate one that you pointed to.

James House - [19/May/06 12:34 PM ]
Indeed, I see that it is different, I will change this to be a "related" task.

I presume that it makes sense to make the group daemon, if the user configured the thread to be daemon.

Jasper Rosenberg - [20/May/06 10:28 AM ]
Made the following changes:

1. If "org.quartz.scheduler.makeSchedulerThreadDaemon" is true, then its thread group is also marked as daemon
2. If "org.quartz.threadPool.makeThreadsDaemons" is true and "org.quartz.threadPool.threadsInheritGroupOfInitializingThread" is false, then mark the new thread group as daemon.

Also updated the configuration Wiki pages to reflect this new behavior.