# Job stopping on new push?

**URL:** <https://forum.gitea.com/t/job-stopping-on-new-push/8142>\
**Category:** Actions\
**Created:** [November 15, 2023, 10:55pm UTC](https://forum.gitea.com/t/job-stopping-on-new-push/8142 "2023-11-15T22:55:51Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![jwalzer](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/jwalzer/32/4128_2.png) [@jwalzer](https://forum.gitea.com/u/jwalzer)\
**Post date:** [November 15, 2023, 10:55pm UTC](https://forum.gitea.com/t/job-stopping-on-new-push/8142/1 "2023-11-15T22:55:51Z")

</div>

So I have a workflow that triggers on `[push,pull-request]`  
in essence nothing fancy. Just one matrix key to build for bullseye and bookworm.  
One last step is a cleanup step which has an `if: ${{ always() }}` clause.  
Works normally quite well …

But: what I’ve seen is that, while the jobs are still running, If I push another new commit to gitea, then suddenly All the running jobs of that repo get canceled and the new ones start.

This even prevents the cleanup-step from triggering, so I have to do the cleanup myself.

Question is: Is this intended behavior or should I troubleshoot, why the jobs get canceled?  
So far the CI-Runner doesn’t look like it has an issue … (I’m using privileged DinD with root)

greetings

---

<div class="post-metadata">

**Author:** ![magnus\_lindstrom](https://avatars.discourse-cdn.com/v4/letter/m/bb73d2/32.png) [@magnus\_lindstrom](https://forum.gitea.com/u/magnus_lindstrom)\
**Post date:** [March 25, 2024, 1:03pm UTC](https://forum.gitea.com/t/job-stopping-on-new-push/8142/2 "2024-03-25T13:03:50Z")

</div>

I’m also interested in an answer to this.

---

<div class="post-metadata">

**Author:** ![wolfogre](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/wolfogre/32/5179_2.png) [@wolfogre](https://forum.gitea.com/u/wolfogre)\
**Post date:** [March 26, 2024, 2:34am UTC](https://forum.gitea.com/t/job-stopping-on-new-push/8142/3 "2024-03-26T02:34:22Z")

</div>

I believe it’s related to

- [Implement auto-cancellation of concurrent jobs if the event is push by appleboy · Pull Request #25716 · go-gitea/gitea · GitHub](https://github.com/go-gitea/gitea/pull/25716)
- [Cancel previous runs of the same PR automatically by wolfogre · Pull Request #29961 · go-gitea/gitea · GitHub](https://github.com/go-gitea/gitea/pull/29961)

---

<div class="post-metadata">

**Author:** ![frd1](https://avatars.discourse-cdn.com/v4/letter/f/97f17d/32.png) [@frd1](https://forum.gitea.com/u/frd1)\
**Post date:** [April 8, 2024, 6:57am UTC](https://forum.gitea.com/t/job-stopping-on-new-push/8142/4 "2024-04-08T06:57:31Z")

</div>

Also interested on this.

It’s happening both with on push and on schedule. As soon as the new push/schedule kicks in, the current job gets stopped and the new one starts.

I tried to setup a lock system, but as it stops at the same time the new one starts, it does not work.

Is there any plans to implement Github’s concurrency system?

> **[Using concurrency - GitHub Docs](https://docs.github.com/en/actions/using-jobs/using-concurrency)**
>
> Run a single job at a time.

What is the state of this?

> <https://github.com/go-gitea/gitea/issues/24769>
>
> \### Feature Description
> 
> simple:
> 
> \`\`\`yaml
> concurrency:
> group: container-…release
> \`\`\`
> 
> advanced:
> 
> \`\`\`yaml
> concurrency:
> group: ${{ github.workflow }}-${{ github.head\_ref || github.run\_id }}
> cancel-in-progress: true
> \`\`\`
> 
> https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#concurrency

Thanks!

---

<div class="post-metadata">

**Author:** ![MarcParcerisa](https://avatars.discourse-cdn.com/v4/letter/m/e9bcb4/32.png) [@MarcParcerisa](https://forum.gitea.com/u/MarcParcerisa)\
**Post date:** [July 19, 2024, 10:59am UTC](https://forum.gitea.com/t/job-stopping-on-new-push/8142/5 "2024-07-19T10:59:44Z")

</div>

Also interested on this. Does anyone know if there is any way to disable this behaviour? I want all my workflow runs to finish no matter what.

---

<div class="post-metadata">

**Author:** ![achikhv](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/achikhv/32/6348_2.png) [@achikhv](https://forum.gitea.com/u/achikhv)\
**Post date:** [October 25, 2024, 12:52am UTC](https://forum.gitea.com/t/job-stopping-on-new-push/8142/6 "2024-10-25T00:52:27Z")

</div>

I would also like some way to disable auto-cancellation. We run set of tests when commit is pushed to main. If commits are pushed frequently enough none of the jobs can run to completion.

Also there is another problem when jobs are executed directly on a host. Normally after job is completed runner cleans it’s cache. But if job is cancelled cache stays there like forever.

---

<div class="post-metadata">

**Author:** ![mosquito520](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/mosquito520/32/4531_2.png) [@mosquito520](https://forum.gitea.com/u/mosquito520)\
**Post date:** [January 12, 2025, 3:56pm UTC](https://forum.gitea.com/t/job-stopping-on-new-push/8142/7 "2025-01-12T15:56:55Z")

</div>

it’s 2025 now  
does anyone know how to solve this problem?  
cause it is really annonying…

---

<div class="post-metadata">

**Author:** ![mhslg](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/mhslg/32/6572_2.png) [@mhslg](https://forum.gitea.com/u/mhslg)\
**Post date:** [January 14, 2025, 2:57pm UTC](https://forum.gitea.com/t/job-stopping-on-new-push/8142/8 "2025-01-14T14:57:44Z")

</div>

I agree, would be great to have a solution for this.
