Skip to content

processor.Nil MarkCancelled overwrites pre-existing item errors #92

Description

@MasterOfBinary

On cancellation, processor.Nil stamps every item unconditionally (processor/nil.go:39-43):

if p.MarkCancelled {
    for _, item := range items {
        item.Error = ctx.Err()
    }
}

An item that already carried an error from an earlier processor in the chain has that error replaced with context.Canceled, losing the original failure cause.

Fix: only set item.Error = ctx.Err() when item.Error == nil.

Found in the 2026-07-10 full-repo review.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions