Skip to content

Calling generate_id() in a transaction blocks #1139

@teh

Description

@teh

Bug reports must include all following items:

  1. expected result

generate an ID and continue

  1. actual result

db.generate_id() blocks

  1. sled version

0.34.2

  1. rustc version

rustc 1.47.0-nightly (d6953df14 2020-07-25)

  1. operating system

nixos

  1. minimal code sample that helps to reproduce the issue
fn test_transaction(db: &sled::Db) -> sled::transaction::TransactionResult<(), ()> {
    db.transaction(|t| {
        let id = db.generate_id()?;
        Ok(())
    })
}

fn test() -> sled::Result<()> {
    let db = sled::open("/tmp/testsled")?;
    test_transaction(&db).unwrap();
    Ok(())
}

#[cfg(test)]
mod tests {
    #[test]
    fn it_works() {
        super::test();
    }
}
  1. logs, panic messages, stack traces

nothing

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions