Skip to content

Commit

Permalink
Do not critically fail when view does not exist (#460)
Browse files Browse the repository at this point in the history
* Do not critically fail when view does not exist

* Add entry to CHANGELOG.md
  • Loading branch information
adzialocha committed Jul 25, 2023
1 parent 10ec033 commit 25707ca
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fix race condition when check for existing view ids was too early [#420](https://github.com/p2panda/aquadoggo/pull/420)
- Use fork of `asynchronous-codec` to temporarily fix CBOR decoding bug [#440](https://github.com/p2panda/aquadoggo/pull/440)
- Fix composing of circuit relay address [#451](https://github.com/p2panda/aquadoggo/pull/451)
- Do not critically fail when view does not exist due to race condition [#460](https://github.com/p2panda/aquadoggo/pull/460)

### Open Sauce

Expand Down
7 changes: 4 additions & 3 deletions aquadoggo/src/materializer/tasks/dependency.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,10 @@ pub async fn dependency_task(context: Context, input: TaskInput) -> TaskResult<T
}
// If no document with the view for the id passed into this task could be retrieved then
// this document has been deleted or the document view does not exist. As "dependency"
// tasks are only dispatched after a successful "reduce" task, neither `None` case should
// happen, so this is a critical error.
None => Err(TaskError::Critical(format!(
// tasks are only dispatched after a successful "reduce" task this is fairly rare, usually
// a result of a race condition where other tasks changed the state before the "dependency"
// task got dispatched.
None => Err(TaskError::Failure(format!(
"Expected document with view {} not found in store",
view_id
))),
Expand Down

0 comments on commit 25707ca

Please sign in to comment.