Skip to content

fix(cost): add restart policy to mc-cost-optimizer-db - #209

Merged
MZC-CSC merged 2 commits into
m-cmp:mainfrom
MZC-CSC:develop
Sep 30, 2026
Merged

MZC-CSC merged 2 commits into
m-cmp:mainfrom
MZC-CSC:develop

Conversation

@MZC-CSC

@MZC-CSC MZC-CSC commented Sep 30, 2026

Copy link
Copy Markdown
Member

Summary

mc-cost-optimizer-db has no restart policy, so it falls back to no.
After a host reboot, the Docker daemon brings back every container that has a restart policy. The cost-optimizer DB is not one of them, so it stays down.
Every cost-optimizer service that depends on it (restart: on-failure) then crash-loops on
UnknownHostException: mc-cost-optimizer-db. mc-cost-optimizer-be stays unhealthy, and APIs such as
POST /api/costopti/be/invoice/getInvoice fail until someone starts the DB by hand.

Changes

  • conf/docker/docker-compose.yaml
    • Add restart: always to mc-cost-optimizer-db. This matches the other DB services in the same file (e.g. mc-application-manager-db).

How to apply on an existing deployment

Recreate the DB container so the new policy takes effect. The data volume is kept, and the image (mariadb:12.3.2) does not change:
docker compose -f conf/docker/docker-compose.yaml up -d --no-deps mc-cost-optimizer-db
Or apply it in place without recreating the container:
docker update --restart always mc-cost-optimizer-db

yh-noh and others added 2 commits September 29, 2026 00:21
mc-cost-optimizer-db had no restart policy (default: no), so it was not
brought back after a host reboot while the dependent cost services
(restart: on-failure) kept crash-looping on UnknownHostException.
Align with other DB services in the file by using restart: always.
fix(cost): add restart policy to mc-cost-optimizer-db
@MZC-CSC
MZC-CSC merged commit 35a7164 into m-cmp:main Sep 30, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants