diff --git a/libsql-server/src/connection/legacy.rs b/libsql-server/src/connection/legacy.rs index 0f4dfeffb5..852f5f19ee 100644 --- a/libsql-server/src/connection/legacy.rs +++ b/libsql-server/src/connection/legacy.rs @@ -380,7 +380,10 @@ where ctx: RequestContext, builder: B, ) -> Result { - let config = self.inner.lock().config(); + let inner = self.inner.clone(); + let config = tokio::task::spawn_blocking(move || inner.lock().config()) + .await + .unwrap(); check_program_auth(&ctx, &pgm, &config).await?; let conn = self.inner.clone(); CoreConnection::run_async(conn, pgm, builder).await diff --git a/libsql-server/src/connection/libsql.rs b/libsql-server/src/connection/libsql.rs index b1acf8d918..4d70a896ea 100644 --- a/libsql-server/src/connection/libsql.rs +++ b/libsql-server/src/connection/libsql.rs @@ -93,7 +93,10 @@ impl LibsqlConnection { ctx: RequestContext, builder: B, ) -> Result { - let config = self.inner.lock().config(); + let inner = self.inner.clone(); + let config = tokio::task::spawn_blocking(move || inner.lock().config()) + .await + .unwrap(); check_program_auth(&ctx, &pgm, &config).await?; let conn = self.inner.clone(); CoreConnection::run_async(conn, pgm, builder).await diff --git a/libsql-server/src/lib.rs b/libsql-server/src/lib.rs index 0d8dc5a74f..7146bbd35e 100644 --- a/libsql-server/src/lib.rs +++ b/libsql-server/src/lib.rs @@ -147,8 +147,8 @@ type MakeReplicationSvc = Box< // static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc; #[global_allocator] -static GLOBAL: rheaper::Allocator = - rheaper::Allocator::from_allocator(mimalloc::MiMalloc); +static GLOBAL: rheaper::Allocator = + rheaper::Allocator::from_allocator(std::alloc::System); #[derive(clap::ValueEnum, PartialEq, Clone, Copy, Debug)] pub enum CustomWAL { diff --git a/libsql-wal/src/segment/current.rs b/libsql-wal/src/segment/current.rs index c8801296ae..15c7ef12ef 100644 --- a/libsql-wal/src/segment/current.rs +++ b/libsql-wal/src/segment/current.rs @@ -654,7 +654,7 @@ impl SegmentIndex { offsets .iter() .rev() - .find(|fno| **fno as u64 <= max_offset) + .find(|fno| (**fno as u64) < max_offset) .copied() }