https://slatedb.io logo
`test db::tests::test_should_recover_imm_from_wal ...
# general
c
test db::tests::test_should_recover_imm_from_wal has been running for over 60 seconds
Passing on GH action, but hanging on my laptop :/
Looks like a regression introducedx in https://github.com/slatedb/slatedb/pull/418
Race condition is triggered on my laptop but not the GH action
/cc @AsukaMilet @actual_04780
a
passing locally
test db::tests::test_should_recover_imm_from_wal ... ok
c
Yea. It's a race condition. Depends on the speed of the machine.
Trying to track it down. I guess switching for Rc to Arc has allowed some more parallelism than before
Copy code
---- db::tests::test_should_recover_imm_from_wal_after_flush_error stdout ----
thread 'db::tests::test_should_recover_imm_from_wal_after_flush_error' panicked at src/db.rs:2521:9:
assertion `left == right` failed
  left: 0
 right: 1
a
revert?
c
Nah let's figure this out 🙂
To replicate:
Copy code
while cargo test test_should_recover_imm_from_wal_after_flush_error --all-targets --all-features -- --nocapture; do :; done
... so... somehow this fixes it?
Copy code
--- a/src/flush.rs
+++ b/src/flush.rs
@@ -126,7 +126,10 @@ impl DbInner {
                         match msg {
                             WalFlushThreadMsg::Shutdown => {
                                 // Stop the thread.
-                                _ = this.flush().await;
+                                let err = this.flush().await;
+                                if let Err(err) = &err {
+                                    println!("error from wal flush: {err}");
+                                }
                                 return Ok(())
                             },
                             WalFlushThreadMsg::FlushImmutableWals => {
🤔
lol now I can't reproduce it
fml
I wonder if Rust somehow optimizes the .await away if you don't look at the response? 🤔
That doesn't seem right...
Maybe it's just slowing things down enough
Hm.. I think we might have a race condition in the test that doesn't have anythign to do with the Rc/Arc
Not sure why it started failing with the most recent change...
Lemme open a PR
Would definitely appreciate some eyes on this one: https://github.com/slatedb/slatedb/pull/420