Skip to content

Improve observability of Lease lock issues #1584

@fh-tmccurdy

Description

@fh-tmccurdy

Describe the feature

When using the LeaderElector class to carry out the election pattern amongst pods, you can choose the ILock implementation. LeaseLock.cs uses the client to perform CRUD operations against a Lease resource. However all HTTP operation errors are swallowed, making debugging difficult.

A way of catching these errors should be exposed.

Is your feature related to a problem?

When I deployed my pod using the kubernetes client, I forgot to give my service account suitable permissions. I gave it get, create, patch and delete but not update. Took me a long time to figure out why it was not working, because there is no observability in the code.

Describe the requested feature

Add OnError event hook to LeaseLock, which fires when HTTP operation errors happen.

Describe alternatives you've considered

Stepping through the code rather than observing behaviour by logs or traces.

Additional Context

N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions