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.
Issue fork drupalci_environments-3466119
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
Comment #3
maxwhiteheadComment #4
andypostMerged and new docker images are rolled for dev
Comment #6
maxwhiteheadTested 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.
Comment #7
andypostDelivered to production, maybe restart can use separate issue
Comment #8
andypostAlso it needs to explore ability to copy prepackaged DB instead of starting and creating users
Comment #9
andypostlet's fix encoding issue in #3468905: Update default system encoding setting for Mysql images