cberner / redb

An embedded key-value database in pure Rust
https://www.redb.org
Apache License 2.0
3.22k stars 147 forks source link

Error ReadTransactionStillInUse(ReadTransaction) when try to close transaction #812

Closed lfld287 closed 4 months ago

lfld287 commented 4 months ago

I just want to make sure that the transaction is over

#[test]
fn test_close_read_transaction() {
    let db_path = "test_close_read_transaction.db";
    let db = redb::Database::create(db_path).unwrap();
    let read_tx = db.begin_read().unwrap();
    let close_result = read_tx.close().unwrap();
}

and the test result:


---- auth::redb_persistence::test::test_close_read_transaction stdout ----
thread 'redb_persistence::test::test_close_read_transaction' panicked at redb_persistence.rs:207:44:
called `Result::unwrap()` on an `Err` value: ReadTransactionStillInUse(ReadTransaction)