Closed penberg closed 1 month ago
@gvos94 Any ideas why the following patch is not enough to fix the benchmark? Are we not dropping the file lock when Database
is dropped?
diff --git a/core/benches/benchmark.rs b/core/benches/benchmark.rs
index 9be7679..2fc08f3 100644
--- a/core/benches/benchmark.rs
+++ b/core/benches/benchmark.rs
@@ -89,6 +89,9 @@ fn bench(c: &mut Criterion) {
},
);
+ drop(conn);
+ drop(db);
+ drop(io);
drop(group);
// https://github.com/penberg/limbo/issues/174
@gvos94 Any ideas why the following patch is not enough to fix the benchmark? Are we not dropping the file lock when
Database
is dropped?diff --git a/core/benches/benchmark.rs b/core/benches/benchmark.rs index 9be7679..2fc08f3 100644 --- a/core/benches/benchmark.rs +++ b/core/benches/benchmark.rs @@ -89,6 +89,9 @@ fn bench(c: &mut Criterion) { }, ); + drop(conn); + drop(db); + drop(io); drop(group); // https://github.com/penberg/limbo/issues/174
I think for this to work the Database and Connection struct need to implement the Drop trait.
@brayanjuls We don't need additional Drop
traits because DarwinFile
already has one, which calls unlock_file()
. The reason you fixed the issue in #223 was because I forgot to drop stmt
(which keeps a reference count to the file, preventing drop).
While your fix is much cleaner, this would have also worked:
@@ -89,6 +34,10 @@ fn bench(c: &mut Criterion) {
},
);
+ drop(stmt);
+ drop(conn);
+ drop(db);
+ drop(io);
drop(group);
// https://github.com/penberg/limbo/issues/174
Thanks for fixing the issue!
I guess we forget to drop the database lock for Limbo benchmarks: