Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions crates/db/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,13 @@ impl Db {
.await
.map_err(|e| DatabaseError::ConnectionPoolObtainError(Box::new(e)))?;

conn.interact(|conn| <_ as diesel::Connection>::transaction::<R, E, Q>(conn, query))
.in_current_span()
.await
.map_err(|err| E::from(DatabaseError::interact(&msg.to_string(), &err)))?
let span = tracing::Span::current();
conn.interact(move |conn| {
let _guard = span.enter();
<_ as diesel::Connection>::transaction::<R, E, Q>(conn, query)
})
.await
.map_err(|err| E::from(DatabaseError::interact(&msg.to_string(), &err)))?
}

/// Run the query _without_ a transaction
Expand Down
9 changes: 7 additions & 2 deletions crates/store/src/db/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -561,12 +561,17 @@ impl Db {

// XXX FIXME TODO free floating mutex MUST NOT exist
// it doesn't bind it properly to the data locked!
if allow_acquire.send(()).is_err() {
tracing::warn!(target: COMPONENT, "failed to send notification for successful block application, potential deadlock");
{
let _span = tracing::info_span!(target: COMPONENT, "acquire_write_lock").entered();
if allow_acquire.send(()).is_err() {
tracing::warn!(target: COMPONENT, "failed to send notification for successful block application, potential deadlock");
}
}

models::queries::prune_history(conn, signed_block.header().block_num())?;

let _span =
tracing::info_span!(target: COMPONENT, "acquire_done_lock").entered();
acquire_done.blocking_recv()?;

Ok(())
Expand Down
Loading
Loading