Skip to content

Commit

Permalink
Merge pull request #419 from kmicklas/mixed-cycle-fallback-docs
Browse files Browse the repository at this point in the history
Remove inaccurate note about mixed cycles failing to recover
  • Loading branch information
nikomatsakis authored Apr 24, 2024
2 parents dcf2b3e + 2aea083 commit 05b4e3e
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions book/src/cycles/fallback.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ fn my_recover_fn(
) -> MyResultValue
```

The `db` and `cycle` argument can be used to prepare a useful error message for your users.
The `db` and `cycle` argument can be used to prepare a useful error message for your users.

**Important:** Although the recovery function is given a `db` handle, you should be careful to avoid creating a cycle from within recovery or invoking queries that may be participating in the current cycle. Attempting to do so can result in inconsistent results.

## Figuring out why recovery did not work

If a cycle occurs and *some* of the participant queries have `#[salsa::cycle]` annotations and others do not, then the query will be treated as irrecoverable and will simply panic. You can use the `Cycle::unexpected_participants` method to figure out why recovery did not succeed and add the appropriate `#[salsa::cycle]` annotations.

0 comments on commit 05b4e3e

Please sign in to comment.