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

Valentin Kulichenko commented on IGNITE-3197:
---------------------------------------------

Andrey,

I'm a bit confused. If you take a look at current version in master [1], it 
already uses {{tryLock}} in {{fileLock(FileChannel ch, boolean shared)}} 
method. Having said that, your diff looks weird. Can you check this?

Basically, I think you just need to catch {{OverlappingFileLockException}} in 
the mentioned {{fileLock(..)}} method and do nothing (debug log message would 
be useful though). Additionally, when writing, I don't think we have to wait at 
all and can exit right away, because we can assume that two nodes will write 
the same content. But this needs to be tested carefully.

You can name the test {{MarshallerContextLockingSelfTest}}.

[1] 
https://github.com/apache/ignite/blob/master/modules/core/src/main/java/org/apache/ignite/internal/MarshallerContextImpl.java

> OverlappingFileLockException in marshaller context
> --------------------------------------------------
>
>                 Key: IGNITE-3197
>                 URL: https://issues.apache.org/jira/browse/IGNITE-3197
>             Project: Ignite
>          Issue Type: Bug
>          Components: general
>    Affects Versions: 1.6
>            Reporter: Valentin Kulichenko
>            Assignee: Andrey Velichko
>            Priority: Minor
>              Labels: important
>             Fix For: 1.8
>
>
> {{MarshallerContextImpl}} uses static locks to avoid writing to the same file 
> concurrently. But if Ignite is running embedded in managed environment (e.g., 
> application server), it's possible that there will be two clients loaded by 
> different  class loaders. In this case they will not share these static locks 
> and therefore they can try to acquire the file lock for the same file, 
> causing the {{OverlappingFileLockException}}:
> {noformat}
> [#|2016-05-17T08:02:21.950+0100|SEVERE|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=291;_ThreadName=Thread-2;|java.nio.channels.OverlappingFileLockException
>  at sun.nio.ch.SharedFileLockTable.checkList(FileLockTable.java:255)
>  at sun.nio.ch.SharedFileLockTable.add(FileLockTable.java:152)
>  at sun.nio.ch.FileChannelImpl.lock(FileChannelImpl.java:1011)
>  at 
> org.apache.ignite.internal.MarshallerContextImpl$ContinuousQueryListener.onUpdated(MarshallerContextImpl.java:239)
>  at 
> org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryHandler.notifyCallback(CacheContinuousQueryHandler.java:655)
>  at 
> org.apache.ignite.internal.processors.continuous.GridContinuousProcessor.processNotification(GridContinuousProcessor.java:967)
>  at 
> org.apache.ignite.internal.processors.continuous.GridContinuousProcessor.access$1900(GridContinuousProcessor.java:94)
>  at 
> org.apache.ignite.internal.processors.continuous.GridContinuousProcessor$8.onMessage(GridContinuousProcessor.java:612)
>  at 
> org.apache.ignite.internal.managers.communication.GridIoManager.invokeListener(GridIoManager.java:1058)
>  at 
> org.apache.ignite.internal.managers.communication.GridIoManager.access$1600(GridIoManager.java:104)
>  at 
> org.apache.ignite.internal.managers.communication.GridIoManager$GridCommunicationMessageSet.unwind(GridIoManager.java:2295)
>  at 
> org.apache.ignite.internal.managers.communication.GridIoManager.unwindMessageSet(GridIoManager.java:1018)
>  at 
> org.apache.ignite.internal.managers.communication.GridIoManager.access$1900(GridIoManager.java:104)
>  at 
> org.apache.ignite.internal.managers.communication.GridIoManager$6.run(GridIoManager.java:987)
>  at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
>  at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
>  at java.lang.Thread.run(Thread.java:745)
> |#]
> {noformat}
> It's actually harmless, but the logs are flooded with the errors.



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

Reply via email to