[jboss-jira] [JBoss JIRA] (DROOLS-3089) ThreadSafeTrackableTimeJobFactoryManager for default

Toshiya Kobayashi (Jira) issues at jboss.org
Mon Oct 8 22:56:00 EDT 2018


     [ https://issues.jboss.org/browse/DROOLS-3089?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Toshiya Kobayashi moved JBPM-7836 to DROOLS-3089:
-------------------------------------------------

              Project: Drools  (was: jBPM)
                  Key: DROOLS-3089  (was: JBPM-7836)
          Component/s: core engine
                           (was: Runtime Engine)
    Affects Version/s: 7.12.0.Final
                           (was: 7.12.0.Final)


> ThreadSafeTrackableTimeJobFactoryManager for default
> ----------------------------------------------------
>
>                 Key: DROOLS-3089
>                 URL: https://issues.jboss.org/browse/DROOLS-3089
>             Project: Drools
>          Issue Type: Enhancement
>          Components: core engine
>    Affects Versions: 7.12.0.Final
>            Reporter: Toshiya Kobayashi
>            Assignee: Maciej Swiderski
>            Priority: Major
>              Labels: support
>
> By default, TrackableTimeJobFactoryManager is set by SessionConfigurationImpl.
> https://github.com/kiegroup/drools/blob/7.11.0.Final/drools-core/src/main/java/org/drools/core/SessionConfigurationImpl.java#L175-L176
> If users access a ksession via multiple threads, it would potentially hit a HashMap concurrency issue (e.g. https://stackoverflow.com/questions/22944918/why-does-the-code-hang-with-hashmap-put-from-multiple-threads).
> ThreadSafeTrackableTimeJobFactoryManager is bundled for multi-thread use. You can use it by
> Drools 7:
> {noformat}
> System.setProperty("drools.timerJobFactory", "thread_safe_trackable");
> {noformat}
> Drools 6.3+:
> {noformat}
> KieSessionConfiguration kconf = KnowledgeBaseFactory.newKnowledgeSessionConfiguration();
> ((org.drools.core.SessionConfiguration)kconf).setTimerJobFactoryType( TimerJobFactoryType.THREAD_SAFE_TRACKABLE );
> KieSession ksession = kContainer.newKieSession("ksession-name", kconf);
> {noformat}
> However, it's better to make ThreadSafeTrackableTimeJobFactoryManager default because "Suddenly hitting an issue in production" is significant than "small overhead by ConcurrentHashMap". (Generally, users are not very conscious about "it is accessed by multi-threads or not")



--
This message was sent by Atlassian Jira
(v7.12.1#712002)


More information about the jboss-jira mailing list