Skip to content

Handle concurrent VCS git commands

Ian requested to merge queue_cmd into develop

Context

The VCS / git commands are currently being executed in parallel when handling client requests. Git itself does have locks to make sure there are no concurrent writes. It just aborts one operation with an warning while the other is running. This merge request makes use of channels to make sure we block and wait for one operation is complete before commencing the others.

Change

I introduced the idea of an Operation which consists of a batch of git commands. The channel (of size 1) is used to queue these operations so all operations are executed in series. The channel of operations will later be used for creating reviews for models as this requires doing a batch of git commands, ie. create new branch, add files, commit, switch back to master branch. While this operation is happening, we should prevent users from reading / writing to the git repo.

WIP - I'm looking for feedback to see if we should go with this approach or not. I've only modified one function (currently GetRevisionCount) to use the new channel of operations.

Edited by Ian

Merge request reports