Skip to content

Commit

Permalink
Add better tracing entries for entering/exiting transactions (#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
swlynch99 authored Sep 16, 2024
1 parent a6ba49f commit a40571e
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions crates/durable-runtime/src/task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -419,9 +419,10 @@ impl TaskState {
}

tracing::trace!(
target: "durable_runtime::task::transaction",
index = self.txn_index,
"entering transaction {}",
options.label
label = &*options.label,
"entering transaction"
);

self.txn = Some(Transaction::new(
Expand Down Expand Up @@ -574,6 +575,13 @@ impl TaskState {
.await?
.running_on;

tracing::trace!(
target: "durable_runtime::task::transaction",
index = self.txn_index,
label = &*txn.label,
"exiting transaction"
);

if running_on != Some(self.worker_id) {
// This task is no longer running on the current worker. Don't commit anything,
// and abort the task.
Expand Down

0 comments on commit a40571e

Please sign in to comment.