Uploaded image for project: 'camunda BPM'
  1. camunda BPM
  2. CAM-11381

Spring Boot starter default filter creation is not resilient in cluster setups

    XMLWordPrintable

Details

    Description

      The Spring Boot starter has a feature that creates a task filter during startup. E.g. in application.yml:

      camunda.bpm.filter:
           create: All tasks
      

      When we have a cluster of Spring Boot nodes that share the same database, this feature is not resilient and can let the application startup fail. In particular, the logic is essentially like this:

      1. Check if there is a filter with the given name
      2. If not, create it

      This procedure is not synchronized across a cluster, e.g. there is no unique constraint on filter names. So there are race conditions that allow multiple filters with this name to be created, and this will subsequent application starts.

      Root cause:

      Step 1 in above sequence makes a #singleResult query. When two nodes see 0 such filters, they each create a new filter. On next startup, a node will find two filters, which lets #singleResult fail.

      Solution:

      Make the feature more resilient such that it does not fail if there are two or more existing filters with the configured name. Document that this setting is not recommended for production settings, because you can end up with multiple filters.

      mgm-controller-panel

        This is the controller panel for Smart Panels app

        Attachments

          Activity

            People

              nikola.koevski Nikola Koevski
              thorben.lindhauer Thorben Lindhauer
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Salesforce