Skip to content

Commit

Permalink
Merge pull request #61 from penberg/fix59
Browse files Browse the repository at this point in the history
database: fix an unwrap() in tx_commit
  • Loading branch information
psarna committed Jul 9, 2023
2 parents 43f554f + c45a34e commit 056af57
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mvcc-rs/src/database/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ impl<Clock: LogicalClock> Database<Clock> {
let end_ts = self.get_timestamp();
// NOTICE: the first shadowed tx keeps the entry alive in the map
// for the duration of this whole function, which is important for correctness!
let tx = self.txs.get(&tx_id).unwrap();
let tx = self.txs.get(&tx_id).ok_or(DatabaseError::TxTerminated)?;
let tx = tx.value().write().unwrap();
match tx.state.load() {
TransactionState::Terminated => return Err(DatabaseError::TxTerminated),
Expand Down

0 comments on commit 056af57

Please sign in to comment.