• Icon: Bug Bug
    • Resolution: Done
    • Icon: Blocker Blocker
    • 7.0.0.GA
    • None
    • None
    • OpenShift
      bpmsuite70-businesscentral-openshift image

      Kie server timers need to be configured with proper clustering timer implementation (database backed EJB timer or Quartz) to work correctly in a cluster.
      Currently they are not configured, resulting in incorrect behaviour. For example if there is defined a process which should start every hour then currently every Kie server instance start the process.

        1. DB-timer.zip
          25 kB
        2. disconnect.txt
          23 kB
        3. expiration.txt
          0.6 kB
        4. illegal-state.txt
          97 kB
        5. stacktrace-postgresql.txt
          31 kB

            [RHPAM-181] Kie server timers aren't clustered

            Karel Suta added a comment -

            Verified in 7.0.0 CR2

            Karel Suta added a comment - Verified in 7.0.0 CR2

            I updated the templates that uses postgresql.

            Filippe Spolti added a comment - I updated the templates that uses postgresql.

            Filippe Spolti added a comment - - edited

            apparently to fix the issue in the attached stack trace, a extra conf is needed at database side:

            this value need to be higher than 0: max_prepared_transactions
            I am not sure if we can configure it at datasource level.

            https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/7.1/html/configuration_guide/datasource_management#vendor_specific_xa_recovery

            Apparently the image has the ability to set it: https://github.com/sclorg/postgresql-container/blob/master/src/root/usr/share/container-scripts/postgresql/openshift-custom-postgresql.conf.template#L15

            ksuta you can try to add the POSTGRESQL_MAX_PREPARED_TRANSACTIONS env.

            Filippe Spolti added a comment - - edited apparently to fix the issue in the attached stack trace, a extra conf is needed at database side: this value need to be higher than 0: max_prepared_transactions I am not sure if we can configure it at datasource level. https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/7.1/html/configuration_guide/datasource_management#vendor_specific_xa_recovery Apparently the image has the ability to set it: https://github.com/sclorg/postgresql-container/blob/master/src/root/usr/share/container-scripts/postgresql/openshift-custom-postgresql.conf.template#L15 ksuta you can try to add the POSTGRESQL_MAX_PREPARED_TRANSACTIONS env.

            Karel Suta added a comment -

            Reopened, failing on PostgreSQL DB when I tried to deploy container containing process with timer [1].

            [1] https://github.com/kiegroup/kie-cloud-tests/tree/master/test-cloud/test-cloud-remote/src/test/resources/kjars-sources/timer-project

            Karel Suta added a comment - Reopened, failing on PostgreSQL DB when I tried to deploy container containing process with timer [1] . [1] https://github.com/kiegroup/kie-cloud-tests/tree/master/test-cloud/test-cloud-remote/src/test/resources/kjars-sources/timer-project

            Karel Suta added a comment -

            Verification is currently blocked by RHPAM-740.

            Karel Suta added a comment - Verification is currently blocked by RHPAM-740 .

            Karel Suta added a comment -

            From my own brief check it seems to work. Will make more tests in Monday.

            Karel Suta added a comment - From my own brief check it seems to work. Will make more tests in Monday.

            Filippe Spolti added a comment - - edited

            After a conversation with Maciej and Marian some extra checks will need to be applied, like:
            -> make the tx_isolation configurable but default it to TRANSACTION_READ_COMMITTED.
            -> both datasources must be XA, maybe force it to be XA even if user specify if to be nonxa.
            -> create only one timer service datastore.

            Filippe Spolti added a comment - - edited After a conversation with Maciej and Marian some extra checks will need to be applied, like: -> make the tx_isolation configurable but default it to TRANSACTION_READ_COMMITTED. -> both datasources must be XA, maybe force it to be XA even if user specify if to be nonxa. -> create only one timer service datastore.

            David Ward added a comment -

            KrisVerlaenen Sorry, just saw your note here. Yes; looking into it.

            David Ward added a comment - KrisVerlaenen Sorry, just saw your note here. Yes; looking into it.

            dward-se-jboss can you work (with QE and Maciej) to make sure this gets resolved?

            Kris Verlaenen added a comment - dward-se-jboss can you work (with QE and Maciej) to make sure this gets resolved?

            Karel Suta added a comment -

            In attachment (DB-timer.zip) you can find standalone reproducer with suggested configuration. It can come handy for local experiments. The reproducer starts 3 WildFly instances with managed Kie servers pointing to same database. It also contains simple test (TimerIT.java) for creating of container with process containing intermediate timer event and starting of several processes in parallel. In the server log (and in console) you can see when the process is started (showing "Before timer") and when the process finished timer event (showing "After timer").
            The reproducer can be executed using "mvn clean install" command.

            Karel Suta added a comment - In attachment (DB-timer.zip) you can find standalone reproducer with suggested configuration. It can come handy for local experiments. The reproducer starts 3 WildFly instances with managed Kie servers pointing to same database. It also contains simple test (TimerIT.java) for creating of container with process containing intermediate timer event and starting of several processes in parallel. In the server log (and in console) you can see when the process is started (showing "Before timer") and when the process finished timer event (showing "After timer"). The reproducer can be executed using "mvn clean install" command.

              rhn-support-fspolti Filippe Spolti
              ksuta Karel Suta
              Karel Suta Karel Suta
              Karel Suta Karel Suta
              Votes:
              0 Vote for this issue
              Watchers:
              11 Start watching this issue

                Created:
                Updated:
                Resolved: