Skip to content
TheChatArchiveThe Chat Archive
Claudeclaude-sonnet-5· anthropicHugging Face ibragim-bad/swe_rebench_07_2026_trajectories

ISSUE DESCRIPTION Woodpecker services appear to be running on UI & API after pipeline…

  1. User

    ISSUE DESCRIPTION

    Woodpecker services appear to be running on UI & API after pipeline completes

    Component

    server

    Describe the bug

    Some regression with newer releases (3.14.x) With kubernetes backend and pipelines defining services, the services are not cleaned properly. The pods from kubernetes backend are destroyed properly, but the woodpecker API still show these steps as state=running.

    These are only cleaned after the pipeline times out. This prevents timely deploys as pipeline executions are not getting green status (although, as a mitigation, the pipeline waiting services can be cancelled, after which the deploy can be made).

    Steps to reproduce

    • Install woodpecker next-d05c597374
    • Use kubernetes backend
    • Define pipeline with services running infinitely, like running postgres
    services:
      - name: postgres
        image: public.ecr.aws/docker/library/postgres:16-alpine3.21
        ports:
          - 5432
        environment:
          POSTGRES_PASSWORD: somepass
          POSTGRES_USER: someuser
          POSTGRES_DB: somedb
    steps:
      - name: wait-for-postgres
        image: public.ecr.aws/docker/library/postgres:16-alpine3.21
        environment:
          DB_HOST: postgres
          DB_PORT: 5432
          MAX_WAIT: 60
        commands:
          - ./scripts/wait-for-postgres.sh
    
    • Run the pipeline, observe pods start for the service and the step
    • once wait-for-postgres step completes, the pods are destroyed, but API still shows the service as running, also visible on Web UI.
    pr-build > clone (#2):
    Step: clone
    Started: 1779195580
    Stopped: 1779195594
    Type: clone
    State: success
    
    pr-build > postgres (#3):
    Step: postgres
    Started: 1779195594
    Stopped: 0
    Type: service
    State: running
    
    pr-build > wait-for-postgres (#4):
    Step: wait-for-postgres
    Started: 1779195596
    Stopped: 1779195602
    Type: commands
    State: success
    

    Expected behavior

    Pipeline services are stopped once the pipeline steps complete, the pipeline completes.

    System Info

    next-d05c597374
    kubernetes backend, bitbucket datacenter forge
    

    Additional context

    No response

    Validations

    Interface

    No new interfaces are introduced.

    ADDITIONAL ADVICE

    Since you are given a git repository, you can use git commands to simplify your work. For example, if you made a mistake and want to revert your changes, you can use git checkout <file> to restore the file to its original state. You can also reset all changes in the repository using git reset --hard command. Additionally, you can use git stash and git stash pop to temporarily save your changes and restore them later. Finally, you can see the changes that you've made (which will be submitted when you call submit) using git status or git diff commands. However you don't need to use git add or git commit before submitting your changes. In fact, submit only submits currently unstaged changes because it uses git diff to get the changes that need to be submitted.

    CHECKLIST

    Before submitting your solution, please go over the following checklist and make sure you've done everything:

    • If an error was reported in the issue description, I have successfully reproduced it.
    • If an error was reported in the issue description, I have confirmed that my fix resolves the error.
    • I have thought about edge cases and made sure my fix handles them as well.
    • I have run existing tests in the repository that might have been affected by the change I made and confirmed that they pass. I want you to list every bullet from this checklist and write your reasoning for why you think you did it or didn't need to.

    Repository has been uploaded and your shell is currently at the repository root. Time to solve the issue!

    (Current directory: /woodpecker, current file: none) bash-$

  2. Claude Assistant

    Now let's view the exact lines of WaitStep to edit precisely.

  3. Claude Assistant

    Now add the k8s errors import aliased and implement changes.

  4. Claude Assistant

    Now let's replace the WaitStep function body.

  5. Claude Assistant

    Now let's replace lines 281-359 with new implementation.

  6. Claude Assistant

    Now let's check the rest and build.

  7. Claude Assistant

    Extra closing brace left over from original. Remove it.

  8. Claude Assistant

    Now build again.

  9. Claude Assistant

    Build succeeds. Now let's run existing kubernetes backend tests and runtime tests.

  10. Claude Assistant

    There's a test build tag required.

  11. Claude Assistant

    All pass, including TestWorkflowUnboundedServiceDoesNotHang. Now let's run full backend kubernetes tests with test tag too (in case some other tests have that tag), and run full pipeline tests.

  12. Claude Assistant

    All tests pass. Now let's write a small reproduction test to simulate the actual bug scenario (pod deletion without going through terminal phase) using the fake kubernetes clientset, to confirm the fix resolves it.

  13. Claude Assistant

    Now let's confirm this test fails without the fix (sanity check by reverting temporarily).

  14. Claude Assistant

    Confirmed the bug and the fix. Restore the fix.

  15. Claude Assistant

    Now run full test suite again to be sure everything still passes after removing the temp test.

  16. Claude Assistant

    All pass, and go vet produced no output (clean). Let's also run overall build for whole repo to catch anything else broken.

  17. Claude Assistant

    That's unrelated to our change (missing frontend build output). Let's check git diff and status.

  18. Claude Assistant

    Good, only the intended file is modified, no leftover test files.

  19. Claude Assistant

    Good, that's fine. Now let's run gofmt/golangci-lint if available.

  20. Claude Assistant

    No formatting issues. Let's check if there's a linter config to run (golangci-lint).

  21. Claude Assistant

    The two failures are pre-existing environment issues (missing frontend web/dist build output), unrelated to our change. All other tests pass.

  22. Claude Assistant

    Confirmed pre-existing, unrelated to our change. Now let's finalize by reviewing the full diff once more.

  23. Claude Assistant

    This looks complete and correct. Let's go through the checklist.

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.