I might have missed some context, but a side note:
> If current thread is write lock owner then it can't acquire read lock.
> RRWL doesn't allow upgrades or downgrades.
>From ReentrantReadWriteLock javadoc:
Reentrancy also allows downgrading from the write lock to a read lock,
by acquiring the
Agree with Andrey and Slava.
Your change could lead to exception in case when current thread does
not own read lock.
> Checking for a writе lock holding through method isHeldByCurrentThread is not
> atomic, so there is no certainty that this thread still owns a write lock.
What do you mean
Write lock is an exclusive lock and no other threads can obtain read or
write lock while current thread holding write lock.
Why you think checking for current thread is lock-owner is not atomic?
A thread that already holds a write lock has no needs to obtain read locks
unless it releases the
Hello Dmitry,
To be honest, I don't quite understand the proposed fix. Could you please
describe in detail the issue you are trying to fix?
By the way, please take a look at
GridCacheDatabaseSharedManager.checkpointReadLock:
@Override public void checkpointReadLock() {
if
Hello, Dmitriy.
Do you have a reproducer? minimal application that can reproduce this specific
bug.
Can you, please, run a TC for your PR and get a TC bot visa?
> 25 февр. 2020 г., в 11:08, Dmitry Gorchakov
> написал(а):
>
> This issue once reproduced in my productive with similar stack
This issue once reproduced in my productive with similar stack trace. During
sources analysis I saw the use unsafe of method
writeLock().isHeldByCurrentThread() for unlocking checkpoint. This may cause
thread to starvation. Problem no longer appeared after local fix.
I prepared pull request
This issue once reproduced in my productive with similar stack trace. During
sources analysis I saw the use unsafe of method
writeLock().isHeldByCurrentThread() for unlocking checkpoint. This may cause
thread to starvation. Problem no longer appeared after local fix.
I prepared pull request
This issue once reproduced in my productive with similar stack trace. During
sources analysis I saw the use unsafe of method
writeLock().isHeldByCurrentThread() for unlocking checkpoint. This may cause
thread to starvation. Problem no longer appeared after local fix.
I prepared pull request
Joel Lang created IGNITE-6530:
-
Summary: Deadlock in checkpointReadLock method in
GridCacheDatabaseSharedManager
Key: IGNITE-6530
URL: https://issues.apache.org/jira/browse/IGNITE-6530
Project: Ignite