Skip to content

Gracefully shut down intermediary container during database image builds#76

Merged
nicksantamaria merged 4 commits intomainfrom
feature/db-image-graceful-shutdown
Oct 16, 2025
Merged

Gracefully shut down intermediary container during database image builds#76
nicksantamaria merged 4 commits intomainfrom
feature/db-image-graceful-shutdown

Conversation

@nicksantamaria
Copy link
Contributor

@nicksantamaria nicksantamaria commented Oct 15, 2025

We've seen occasional instances where database images are corrupted, and do not start. I believe (with no direct evidence) that this is caused by the intermediate database container being killed abruptly.

This change does a graceful shutdown of the mysql service, which hopefully ensures the datadir is not corrupted.

required: true
SLACK_WEBHOOK_URL:
required: true
DB_IMAGE_MARIADB_ROOT_PASSWORD:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has been added as an org secret

@nicksantamaria nicksantamaria marked this pull request as ready for review October 15, 2025 04:41
@nicksantamaria nicksantamaria requested a review from GROwen October 15, 2025 04:41
GROwen
GROwen previously approved these changes Oct 15, 2025
run: docker stop "${{ steps.container.outputs.id }}"
- name: Gracefully shutdown the intermediary container
run: docker exec -i "${{ steps.container.outputs.id }}" mysqladmin -u root -p${{ secrets.DB_IMAGE_MARIADB_ROOT_PASSWORD }} shutdown
continue-on-error: true
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is needed as docker returns an exit code 137 after that command (which is expected - its a SIGKILL code)

@nicksantamaria nicksantamaria merged commit 2091861 into main Oct 16, 2025
@nicksantamaria nicksantamaria deleted the feature/db-image-graceful-shutdown branch October 16, 2025 05:30
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