Skip to content

Commit

Permalink
MET-2698 - Changing the startup order for user-metering sidecar (#784)
Browse files Browse the repository at this point in the history
* MET-2698 - Changing the startup order for user-metering sidecar

* MET-2698 - Increased timeout due to failures in the pipeline
  • Loading branch information
rus-kh authored Aug 15, 2024
1 parent 3f28d91 commit 91d72fb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
9 changes: 6 additions & 3 deletions buildpack/start.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,17 +190,20 @@ def _register_signal_handlers():
telegraf.run(runtime_version)
datadog.run(model_version, runtime_version)
fluentbit.run(model_version, runtime_version)
metering.run()
logs.run(m2ee)
runtime.run(m2ee, logs.get_loglevels())
metrics.run(m2ee)
appdynamics.run()
nginx.run()

# Wait for the runtime to be ready before starting Databroker
# Block of code where the order is important
# Wait for the Runtime to be ready before starting Databroker and User-metering Sidecar to not block the Runtime from start
runtime.await_database_ready(m2ee)
metering.run()
if databroker.is_enabled():
runtime.await_database_ready(m2ee)
databroker_processes.run(database.get_config())
# End of the block where order is important

except RuntimeError as re:
# Only the runtime throws RuntimeErrors (no pun intended)
# Don't use the stack trace for these
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def stage(

return result

def start(self, start_timeout=120, health="healthy"):
def start(self, start_timeout=180, health="healthy"):
self._check_for_cflocal()

if not self._container_id:
Expand Down Expand Up @@ -500,7 +500,7 @@ def stage(self, *args, **kwargs):

return super().stage(*args, **kwargs)

def start(self, start_timeout=120, health="healthy"):
def start(self, start_timeout=180, health="healthy"):
# Wait until the database is up
@backoff.on_predicate(backoff.expo, lambda x: x > 0, max_time=30)
def _await_database():
Expand Down

0 comments on commit 91d72fb

Please sign in to comment.