Skip to content

Freestyle build interrupted during a post-build publisher reports FAILURE instead of ABORTED #26879

@jnowjack-lucidchart

Description

@jnowjack-lucidchart

Jenkins and plugins versions report

Environment
Jenkins: 2.516.3
OS: Linux - 6.8.0-1042-aws
Java: 21.0.11 - Amazon.com Inc. (OpenJDK 64-Bit Server VM)

What Operating System are you using (both controller, and any agents involved in the problem)?

Ubuntu 22.04 LTS

Reproduction steps

  1. Create a freestyle project with any publisher (e.g. Archive the artifacts).
  2. Start a build and, while the publisher is running, abort it (or have it superseded /reclaimed) — i.e. executor.interrupt(Result.ABORTED).

Expected Results

build result is ABORTED

Actual Results

build result is FAILURE, and the log shows "aborted due to exception" with a stack trace.

Anything else?

When a freestyle build is interrupted (executor.interrupt(Result.ABORTED), e.g. a supersede/cancel, a build timeout, or an EC2 spot reclamation) while a publisher is running in the post-production phase, most importantly the "Archive the artifacts" step, you get a Result.FAILURE instead of Result.ABORTED.

This only affects the publisher (post-build) phase. An interrupt during the main build phase is already honored as ABORTED, and Pipeline jobs abort correctly because WorkflowJob carries the interrupt as a FlowInterruptedException with the Result attached. The bug is specific to the AbstractBuild publisher loop.

Are you interested in contributing a fix?

Yes

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions