TraceMachina / TraceMachina/nativelink
Retry logic introduces too much cognitive complexity
Open
@aaronmondal is already working on this.
Since Oct 22, 2023.
enhancement
- Dominant language
- Rust
- Stars
- 1.6k
- Forks
- 244
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 54
Description
Spin off from https://github.com/TraceMachina/turbo-cache/pull/324 and I've noticed this in other parts of the codebase as well. The current way to add retry capabilities is this:
self.retrier
.retry(
retry_config,
unfold(thing, move |thing| async move {
// Do something.
}),
)
.await
That's three levels of nesting where the // Do something can get fairly complex as it basically contains the entire stream/state handling logic. Surely there is a more readable way to do this.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.