Skip to content

Fix two race conditions in gitlab-ctl reconfigure chef scripts

Fixes two race conditions in gitlab-ctl reconfigure.

  1. An issue I observed in LXC test environments where the gitlab-runsvdir service status check would fail due to the newly created config file not having been loaded by upstart. A manual configuration reload has resolved this issue entirely.

I was seeing this issue approxmiately 1/10 first runs of reconfigure but only in my LXC environment with this fix I have tested 100 runs without failure.

  1. Was a race condition between the postgresql server service being started (a command which returns before the service is started) and the first sql command to create the user being run. I have added 20 retries to the user creation command.

It may be that a better fix for this is to add a separate execute block after the service start to run an arbitrary command in case a new first command is added before the user creation. (It looks as though the create database command below the create user has a retries set)

Merge request reports