Problem/Motivation

Have observed a race condition in which the startup script sees mysqld port open, before DB logs it is ready to accept connections. Script tries to create users before DB is ready, which fails and causes subsequent tests to fail.

Goal is that this will prevent creating users until DB is ready for these operations.

Steps to reproduce

This is a race condition and not reliably reproduced, I have only reproduced with mysql-8 image. Both the mysql 8 + 8.4 images had a change to use `echo > /dev/tcp/localhost/3306;`. I am unsure if this problem exists on images that test port with `netcat -vz localhost 3306;`.

Proposed resolution

Test DB with `mysqladmin ping`

Remaining tasks

Change mysql 8 images to use `mysqladmin ping` and test.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

MaxWhitehead created an issue. See original summary.

maxwhitehead’s picture

Status: Active » Needs review
andypost’s picture

Merged and new docker images are rolled for dev

maxwhitehead’s picture

Tested dev image and ran pipeline several times, have not reproduced original issue, startup script seems to wait for DB to be ready before creating users. Opened merge request to prod images.

andypost’s picture

Status: Needs review » Reviewed & tested by the community
Related issues: +#3458690: Add MySQL 8.4 LTS and 9.0 support

Delivered to production, maybe restart can use separate issue

andypost’s picture

Also it needs to explore ability to copy prepackaged DB instead of starting and creating users

andypost’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.