Prevent multiple concurrent equivalent checkouts
Although we talked about splitting the tasks in slot checkout and artifact production, I realized that approach has two major flaws:
- the artifact production task is not uniquely identified by the artifact name
- it would be possible, but very difficult, to record the build instructions for an artifact, so that the name can be used to trigger its creation
- Luigi would be able to coordinate the artifact production tasks only withing one graph, not across graphs, as we need when triggering multiple slots
So I decided to implement a locking mechanism (backed by CouchdB) to synchronize checkout jobs so that only one actually runs the checkout, while the others wait the the artifact is produced.