Skip to content

Commit

Permalink
Merge #1481
Browse files Browse the repository at this point in the history
1481: fix bug in index deletion r=Kerollmops a=MarinPostma

this bug was caused by a heed iterator entry being deleted while still holding a reference to it.


close #1333


Co-authored-by: mpostma <postma.marin@protonmail.com>
  • Loading branch information
bors[bot] and MarinPostma authored Jul 6, 2021
2 parents 0d1f5b7 + 066085f commit 487d827
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -442,13 +442,16 @@ impl UpdateStore {

while let Some(Ok(((_, uuid, _), pending))) = pendings.next() {
if uuid == index_uuid {
unsafe {
pendings.del_current()?;
}
let mut pending = pending.decode()?;
if let Some(update_uuid) = pending.content.take() {
uuids_to_remove.push(update_uuid);
}

// Invariant check: we can only delete the current entry when we don't hold
// references to it anymore. This must be done after we have retrieved its content.
unsafe {
pendings.del_current()?;
}
}
}

Expand Down

0 comments on commit 487d827

Please sign in to comment.