Skip to content

Change config lock to create a separate lock file

What does this MR do?

Change config lock to create a separate lock file

Why was this MR needed?

When creating a lock create a new lock file, for example config.toml.lock to prevent gitlab-runner run process using the same config file, and fix issues for Windows where there is only exclusive locks (so no other process can even read from it).

With this change, we still end up allowing users using the same config file when they just mount the config.toml file to a Docker container since the lock file is not mounted so we lose that functionality. This is expected and is a more complex thing to fix, which a file lock is not enough, that kind of locking should happen on GitLab coordinator side.

Testing

Windows

  • Run runner process
  • Try to run another runner process, which fails
  • Register new runner

Screen_Shot_2019-10-29_at_13.31.33

Does this MR meet the acceptance criteria?

  • Documentation created/updated
  • Added tests for this feature/bug
  • In case of conflicts with master - branch was rebased

What are the relevant issue numbers?

closes #4691 (closed) #4721 (closed)

Merge request reports