Enhanced exception structure and handling

Registered by Yash Gupta

Presently, there is very little structure in the exceptions used in kuryr-kubernetes. It would be helpful to have a unified structure to all exceptions that are expected to be raised as part of normal kuryr operation. This document proposes a structure with severity levels and logical inheritance to better reflect the cause of and action taken for exceptions.

The proposed class structure can be seen at the spec details url.

- isFatal controls if the exception will cause kuryr-controller/kuryr-cni to crash or enter unhealthy state.
- RecoverableError can be fatal or not, depending on value returned by isRecoveryPossible() (which could internally implement a simple counting mechanism upto a threshold).
- This is useful for temporary errors like unreachable api's (k8s, keystone, neutron, ovs), race conditions, etc.
- Each exception under RecoverableError can implement its own isRecoveryPossible() method to have independent mechanisms.

Blueprint information

Status:
Not started
Approver:
None
Priority:
Undefined
Drafter:
Yash Gupta
Direction:
Needs approval
Assignee:
None
Definition:
New
Series goal:
None
Implementation:
Unknown
Milestone target:
None

Related branches

Sprints

Whiteboard

Gerrit topic: https://review.opendev.org/#/q/topic:bp/exceptions-structure

Addressed by: https://review.opendev.org/695621
    Add specs for new exception structure

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.