-
Notifications
You must be signed in to change notification settings - Fork 102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
More trace logs for TX locking #1253
Conversation
let res = f(&mut tx); | ||
self.inner.release_tx(ctx, tx); | ||
self.release_tx(ctx, tx); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these are so we get the log messages consistently
@@ -125,7 +125,7 @@ impl SubscriptionManager { | |||
let tables = &event.status.database_update().unwrap().tables; | |||
let slow = db.read_config().slow_query; | |||
let tx = scopeguard::guard(db.begin_tx(), |tx| { | |||
tx.release(&ExecutionContext::incremental_update(db.address(), slow)); | |||
db.release_tx(&ExecutionContext::incremental_update(db.address(), slow), tx); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so we get the log messages consistently
@@ -300,7 +304,7 @@ impl RelationalDB { | |||
|
|||
#[tracing::instrument(skip_all)] | |||
pub fn release_tx(&self, ctx: &ExecutionContext, tx: Tx) { | |||
log::trace!("ROLLBACK TX"); | |||
log::trace!("RELEASE TX"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this was a typo?
} | ||
|
||
#[tracing::instrument(skip_all)] | ||
pub fn begin_tx(&self) -> Tx { | ||
log::trace!("BEGIN TX"); | ||
self.inner.begin_tx() | ||
let r = self.inner.begin_tx(); | ||
log::trace!("ACQUIRED TX"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when we were debugging lock issues, we appreciated not only having a "trying to acquire lock" message but also a "I am now holding the lock" message.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Description of Changes
Some small changes to make the trace logs more consistent for tx locks.
API and ABI breaking changes
Nope
Expected complexity level and risk
1
Testing
This is a holdover from a debugging session. It was tested-by-fire.