[ 
https://issues.apache.org/jira/browse/IGNITE-642?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15241384#comment-15241384
 ] 

Yakov Zhdanov commented on IGNITE-642:
--------------------------------------

Vlad,

I tried to fix serialization for lock (and for semaphore, btw) and added few 
tests after Alexey's suggestions on dev list and found this:

{noformat}
Code:
        final IgniteLock lock = ignite1.reentrantLock("lock", true, true, true);

        info("Lock created: " + lock);

        lock.isFailoverSafe();
        lock.isFair();


[19:36:34,413][ERROR][main][root] Test failed.
java.lang.NullPointerException
        at 
org.apache.ignite.internal.processors.datastructures.GridCacheLockImpl$Sync.access$1100(GridCacheLockImpl.java:120)
        at 
org.apache.ignite.internal.processors.datastructures.GridCacheLockImpl.isFailoverSafe(GridCacheLockImpl.java:1426)
        at 
org.apache.ignite.internal.processors.cache.distributed.GridCacheLockAbstractTest.testLockSerialization(GridCacheLockAbstractTest.java:335)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at junit.framework.TestCase.runTest(TestCase.java:176)
        at 
org.apache.ignite.testframework.junits.GridAbstractTest.runTestInternal(GridAbstractTest.java:1759)
        at 
org.apache.ignite.testframework.junits.GridAbstractTest.access$000(GridAbstractTest.java:118)
        at 
org.apache.ignite.testframework.junits.GridAbstractTest$4.run(GridAbstractTest.java:1697)
        at java.lang.Thread.run(Thread.java:724)
{noformat}

I suppose this should not throw an exception. Can you please take a look? Can 
you please create a test that calls all public methods so we can make sure 
there are no issues like this missed?

Please also review Alexey's and my commits (branch ignite-642). Semaphore and 
lock serialization seems to work. However, we need to fix the issues found and 
make another review round.

Thank you for your efforts!

> Implement IgniteReentrantLock data structure
> --------------------------------------------
>
>                 Key: IGNITE-642
>                 URL: https://issues.apache.org/jira/browse/IGNITE-642
>             Project: Ignite
>          Issue Type: Sub-task
>          Components: data structures
>    Affects Versions: 1.6
>            Reporter: Dmitriy Setrakyan
>            Assignee: Vladisav Jelisavcic
>              Labels: features
>             Fix For: 1.6
>
>
> We need to add {{IgniteReentrantLock}} data structure in addition to other 
> data structures provided by Ignite. {{IgniteReentrantLock}} should have 
> similar API to {{java.util.concurrent.locks.ReentrantLock}} class in JDK.
> As an example, you can see how 
> [IgniteCountDownLatch|https://github.com/apache/incubator-ignite/blob/master/modules/core/src/main/java/org/apache/ignite/IgniteCountDownLatch.java]
>  is implemented in 
> [GridCacheCountDownLatchImpl|https://github.com/apache/incubator-ignite/blob/master/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheCountDownLatchImpl.java]
>  class.
> In general we need to have an entity in ATOMIC cache storing lock-owner 
> identifier together with a queue of waiters.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to