Cancel build sometimes doesn't cancel all jobs

I canceled my builds in my private repo. There are 6 jobs in every build.
Usually I cancel a build, the third job and fourth job were not cancel.

What infomation can I provide?

Thanks, Aray.

Hi @sih4sing5hong5,

Is this still occurring?

It worked normally yesterday. I tried three builds :slight_smile:

Usually I cancel a build, the third job and fourth job were not cancel.
I tried over 10 builds 2 weeks ago.

Hi @sih4sing5hong5,

Great to hear!

It’s occurring, this time is in our public repo.

This repo has 5 concurrent jobs.

The steps as below:

  1. Check there is no running job.
  2. git push and cancel the build within 5 seconds.
  3. Restart the first jobs.
  4. The 6th, 8th, 9th and 10th jobs is running. They don’t have running after finishing.

It may be a race-condition.

Thanks :slight_smile:

Hey @sih4sing5hong5,

I’m thinking the best way to solve this is to run a chunk of user code before the stock installation logic occurs.

As it is now, stock installation logic (platform install, build addons) run before any user-supplied code gets control. As a consequence, if that logic doesn’t quite fit the needs or something goes wrong with it, all a user can do is ditch it altogether.

Alternatively, you can check at job start if it needs to be run and quit it early (with travis_terminate or by making the rest of your logic a no-op if you need further automatic steps like saving the cache to run) if it doesn’t. Currently, you can only do this as early as at before_install.

This wouldn’t be an issue on Travis CI Enterprise, because this would allow you to build on your own worker machines of however much power you need. If you need to run 50 jobs in parallel every build and lots and lots of builds per day, which you seem to be a large-scale enough consumer for that, then that might be something you want to look into.

For the race-condition, I’ll look over your .travis.yml carefully.

Cheers,
Montana Mendy

1 Like

Thanks, I will try it :slight_smile:

Hi @sih4sing5hong5,

No problem!