-
Notifications
You must be signed in to change notification settings - Fork 532
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
Conversation
87818d0
to
52be053
Compare
while (!lock.compareAndSwapValue(UNLOCKED, PID)) { | ||
currentLockValue = lockGetCurrentLockValue(tlPauser); | ||
} | ||
|
||
// Set tid explicitly here | ||
lockedByThread = Thread.currentThread(); |
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.
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.
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.
actually, as discussed, lets re-use existing lockedByThread and enable with jvm.resource.tracing a new property
98b4296
to
5988b92
Compare
8c19cbb
to
43f6c53
Compare
src/main/java/net/openhft/chronicle/queue/impl/single/TableStoreWriteLock.java
Show resolved
Hide resolved
43f6c53
to
7a82a0f
Compare
@@ -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()); |
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.
excellent
Quality Gate passedIssues Measures |
Thread ID stored when lock for queue is acquired, and output when attempt to acquire lock by current process fails.