Functions can be marked as idempotent
A function can be marked as idempotent which means it is safe to replay, e.g. in case of failure.
- [ ] Bug
- [x] Feature
- [ ] Enhancement
Detailed Description
Add boolean field idempotent (defaulting to false) to mark a function as safe to replay.
If a failure occurs while running a function, try to replay it according to default replay settings (which also need to be added).
Context
If a function is known to be idempotent and its run fails for reasons other than function code error or incorrect input, automatically retrying to run the function would make its users happier.
Possible Implementation
Function run is recorded upon instantiation. We need to add timeout and sync logic to replay the run if it is stuck in INITIALIZED (for all functions) or ERROR (for idempotent only, and only for "system" errors) state beyond the timeout. This should be part of the control loop (i.e. eventual consistency)
Complexity
- [ ] Low - Simple enhancement or bug fix, no architectural changes or refactoring
- [x] Medium - Change requires some thought, but is relatively isolated
- [ ] High - Significant architectural change or large refactor
Impact
- [ ] Low - Annoyance, but does not impact business or functionality
- [x] Medium - Issue can be worked around, but is causing pain
- [ ] High - Blocker