Remove infinite loop on Optimize startup with ES connection error

XMLWordPrintable

    • Type: Task
    • Resolution: Unresolved
    • Priority: L3 - Default
    • None
    • Affects Version/s: None
    • Component/s: backend
    • None
    • Not defined

      When Optimize starts, it currently gets in an infinite loop if it can't connect to ES. This is not good practice and we should break out of this loop and allow Optimize to fail rather than continually retrying.

      ATs:

      • Optimize doesn't get stuck in an infinite loop on startup with connection errors to ES
      • The amount of time that Optimize should retry for should be configurable

      Testing Notes:

      • Start Optimize without ES running. Observe the logs and see the repeated lines:
        • 13:48:57.428 [main] ERROR o.c.o.u.e.ElasticsearchHighLevelRestClientBuilder - Can't connect to any ES node right now.
          13:48:57.428 [main] INFO  o.c.o.u.e.ElasticsearchHighLevelRestClientBuilder - No Elasticsearch nodes available, waiting [2000] ms to retry connecting
          13:48:59.437 [main] ERROR o.c.o.u.e.ElasticsearchHighLevelRestClientBuilder - Can't connect to any ES node right now.
      • Configure the max wait time using the env var CAMUNDA_OPTIMIZE_ELASTICSEARCH_CONNECTION_MAXIMUM_WAIT_IN_MS. Observe that after the time elapses (default is 60000), Optimize is allowed to fail and won't start up
      • Configure the same in the config file with es.connection.maximumWaitInMs and observe the same behaviour

            Assignee:
            Unassigned
            Reporter:
            Joshua Windels
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: