Commit ea2a464
committed
strategy/common: introduce never_retry decorator
Introduce a decorator meant to decorate the strategy's transition() and
force() methods. It stores the original exception in the broken
attribute and raises a StrategyError from it. All subsequent calls to the
decorated method will lead to the same exception.
This prevents a strategy from subsequent use after an exception
happened, thus no cascading errors can happen.
Signed-off-by: Bastian Krause <bst@pengutronix.de>1 parent 92a9541 commit ea2a464
2 files changed
Lines changed: 25 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
1 | 3 | | |
2 | 4 | | |
3 | 5 | | |
4 | 6 | | |
5 | 7 | | |
6 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
7 | 31 | | |
8 | 32 | | |
9 | 33 | | |
| |||
0 commit comments