replace QuartzScheduler with a more lightweight scheduler

The new scheduler is based on the cron-utils package and uses the same cron syntax as quartz.
CronScheduler was mainly introduced, because of a ClassLoader leak with the old Quartz implementation.
The leak comes from shiros use of InheriatableThreadLocal in combination with the WorkerThreads of Quartz.
CronScheduler uses a ThreadFactory which clears the Shiro context before a new Thread is created (see CronThreadFactory).
This commit is contained in:
Sebastian Sdorra
2019-06-05 16:15:06 +02:00
parent 2b64a49e11
commit 3c373a4c4d
20 changed files with 746 additions and 818 deletions

View File

@@ -80,7 +80,7 @@ import sonia.scm.repository.api.RepositoryServiceFactory;
import sonia.scm.repository.spi.HookEventFacade;
import sonia.scm.repository.xml.XmlRepositoryDAO;
import sonia.scm.repository.xml.XmlRepositoryRoleDAO;
import sonia.scm.schedule.QuartzScheduler;
import sonia.scm.schedule.CronScheduler;
import sonia.scm.schedule.Scheduler;
import sonia.scm.security.AccessTokenCookieIssuer;
import sonia.scm.security.AuthorizationChangedEventProducer;
@@ -218,7 +218,7 @@ public class ScmServletModule extends ServletModule
bind(PluginManager.class, DefaultPluginManager.class);
// bind scheduler
bind(Scheduler.class).to(QuartzScheduler.class);
bind(Scheduler.class).to(CronScheduler.class);
// bind health check stuff
bind(HealthCheckContextListener.class);