Skip to content
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

Improve TableStoreWriteLock 'locked by me' message #1614

Merged
merged 1 commit into from
Sep 23, 2024

Conversation

chroniclekevinpowe
Copy link
Contributor

Thread ID stored when lock for queue is acquired, and output when attempt to acquire lock by current process fails.

@chroniclekevinpowe chroniclekevinpowe changed the base branch from ea to develop September 18, 2024 09:36
@chroniclekevinpowe chroniclekevinpowe force-pushed the feature/store-lock-tid branch 3 times, most recently from 87818d0 to 52be053 Compare September 18, 2024 10:28
while (!lock.compareAndSwapValue(UNLOCKED, PID)) {
currentLockValue = lockGetCurrentLockValue(tlPauser);
}

// Set tid explicitly here
lockedByThread = Thread.currentThread();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thread.currentThread() can be slow - maybe we need to hide this behind a feature property. Maybe we can even piggy back on one of the existing ones.

Copy link
Contributor

@JerryShea JerryShea Sep 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually, as discussed, lets re-use existing lockedByThread and enable with jvm.resource.tracing a new property

@@ -123,9 +127,10 @@ private String lockHandleTimeoutExCreateWarningMessage(String lockedBy) {

@NotNull
protected String getLockedBy(long value) {
String threadId = lockedByThread == null ? "unknown - " + STORE_LOCK_THREAD + " not set" : Long.toString(lockedByThread.getId());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

excellent

@chroniclekevinpowe chroniclekevinpowe merged commit cdb5115 into develop Sep 23, 2024
10 of 12 checks passed
@chroniclekevinpowe chroniclekevinpowe deleted the feature/store-lock-tid branch September 23, 2024 02:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants