-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Race condition deleting build #34
Comments
Oh no, when I clicked restart build it deleted the old logs :( |
Inserting a delay into one of the arches should reduce the probability of timing collissions... I think |
Just want to point out that there are two different race conditions that can happen:
All those race conditions are solvable by using the new Stages feature of Travis-CI. The stages feature allows you to combine jobs into stages, and each stage runs sequentially, e.g. jobs from stage 2 don't start running until jobs from stage 1 finish. The jobs within a stage run in parallel, just like they usually are. So, the idea here is that you have two stages. All of your regular jobs are in the first stage, and each job creates their own draft release. They use As you can see, the race condition in (1) doesn't happen anymore, the jobs can't overwrite the release, since each job creates their own separate draft release. The race condition of (2) is also removed, as each build creates its own numbered release To fix the race conditions you will have to give up on a single The jobs create draft releases, so they would be visible only to repo owners, regular users won't see them. The users might see several |
That sounds like it'd break appimageupdate though, because it can no longer just watch the continuous branch. |
It could be patched to work with this. |
Another way to go about it, one that allows to have a This obviously solves (1) race condition. There also should be no (2) race condition, because even if a new build gets created right after an alredy running build queries the API/git to make sure that there is no newer build, which is a new race condition, there should be enough delay between the two for the older build to finish uplading artifacts before the newer build deletes the I'm happy with this solution too, it eliminates both race conditions, and the new race condition that could happen is very unlikely to happen, and if it does happen to you, it is fully solvable with a long enough |
The only downside to this solution is that if you have, for example, 3 builds running, then the older two builds would not publish build artifacts, because they will see there is a newer third build going on and will exit, and if the newer third build fails, then none of those 3 builds will publish build artifacts. This doesn't happen with the 1st solution I proposed, but with it you don't get the |
Right now it works for me (tm) and every change is likely to break it... |
Thanks for the heads-up, we will not expect this bug be fixed anytime soon then. |
I was running into this since I upload Linux and Mac continuous builds to my project and found a fix here: https://github.com/olive-editor/olive/blob/master/.travis/after_success.sh I've copied that code to my yml file here: https://github.com/leozide/leocad/blob/master/.travis.yml May not solve all cases but it's been working for me so far. |
I have published code for |
I use uploadtool.sh for both macOS .dmg and Linux AppImage on https://github.com/Pext/Pext/releases. Someone, a race condition make the macOS build delete the AppImage build.
At the time this happened, Pext/Pext@5458d76 was the most recent continous commit. Which is build 370 on Travis: https://travis-ci.org/Pext/Pext/builds/362457504.
I won't wait forever with pushing more commits, which will surely fix it again, but hopefully the logs can help you figure out how the race condition happened.
The text was updated successfully, but these errors were encountered: