Skip to content

level=ERROR msg="error received after stop sequence was engaged" err="leader election lost" #3535

Description

@mxey

When running a controller manager with LeaderElection enabled, shutting down the manager will obviously release the leader lock. However, this seems to still trigger a “leader election lost” error:

level=ERROR msg="error received after stop sequence was engaged" err="leader election lost"

On its own, this is just a nitpick, but the problem is in combination with using the t.Output() writer in your test functions. Tests are not allowed to keep writing to it after the test has finished. You will either get a panic, or might even get a data race detected if you run the test with the race detector.

The problem here is that the manager keeps doing something even after its Start method has already returned. The log is a symptom of that, but IMO the manager should be completely gone once Start returns.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions