Skip to content

Kubernetes backend continues to execute on cancelled pipeline execution #6184

@hhamalai

Description

@hhamalai

Component

agent

Describe the bug

I noticed plausible regression with how Kubernetes backend schedules and executes steps when user cancel the pipeline. On UI the running step is receiving logs after the cancel is hit, after the step pod completes, following steps are not producing logs to UI, but the step pods are executed on my local kind cluster.

I bisected the change to 06818ee / #6056 . Before that the running step pods were terminated and no further execution were happening.

With the changes from that commit the line in screenshot is evaluated false (state.error == ErrExternal) and nil is returned, and there's not checks for pipeline cancellations.

Steps to reproduce

With a kubernetes backend

  • run a pipeline
  • cancel it while a step is running
  • observe logs are still produced on Woodpecker UI and further steps are executed on cluster

Expected behavior

Running step pods should be cancelled, no further execution of the remaining pipeline steps

System Info

{"source":"https://github.com/woodpecker-ci/woodpecker","version":"dev"} 
Running from 06818ee6adc563c0c48767eac21a67aba313c1ba
Kubernetes backend with `kind`

Additional context

No response

Validations

  • Read the docs.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Checked that the bug isn't fixed in the next version already [https://woodpecker-ci.org/versions]

Metadata

Metadata

Assignees

Labels

blockedsomething external is blocking itbugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions