Open mmoreram opened 10 years ago
ping @alch What do U think?
It is already working this way :)
Ok, could you please point where is refusing new commits while workers are working?
Sorry I got what you mean now. We already have a queue that work in the way you propose. However no blocking is enforced at github side: we have only one worker active, so there is no parallel execution. Events that insert in the github-split-queue will be served serially, since the subprocess in https://github.com/elcodi/github-webhook/blob/master/bin/worker.php#L35 is executed synchronically.
Ideally, we want the push event to pass the split process a commit, so that we would clone the repo and start the split & tag process from there. The worker should launch a single process that does the split & tag up to that commit.
Were you worried about some specific scenario about this? Since we do not do force pushes or move tags, even if we spawned several workers that could work concurrently, the worst that can happen is that a worker invoked from a previous push would find its pushes denied (being a no-ff push) when updating subpackages
Block all github movements while split and tag workers are running.
We could work with a stack. Every time new commit or tag is added, both scripts should increment by one a simple stack. ASAP they finish, they should decrement this stack by one.
So, when new commits or tags, for example, are added, they should be refused as long as this stack is greater than 0 ( processes still running ).
With this feature, we could avoid the scenario of adding new commits while tag propagation is running.