You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@geode.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2018/02/09 22:11:00 UTC

[jira] [Commented] (GEODE-4615) Deadlock shutting down client cache

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

ASF subversion and git services commented on GEODE-4615:
--------------------------------------------------------

Commit cb82c21f22fc8a56958f4091fed5d90dc055190e in geode's branch refs/heads/develop from [~bschuchardt]
[ https://gitbox.apache.org/repos/asf?p=geode.git;h=cb82c21 ]

GEODE-4615 Deadlock shutting down client cache

Disallow adding a new connection to the ConnectionMap when it is being
closed.

This revision replaces the connection map's connection list with a
poisoned list under sync and then closes each connection outside
of the connection map's lock.  This removes the lock inversion since
the closing thread no longer holds the map's lock.  The thread adding
a connection will either see closing==true or it will try to add
the connection to the poisoned list.  Either results in it
throwing a CacheClosedException.


> Deadlock shutting down client cache
> -----------------------------------
>
>                 Key: GEODE-4615
>                 URL: https://issues.apache.org/jira/browse/GEODE-4615
>             Project: Geode
>          Issue Type: Bug
>          Components: client/server
>    Affects Versions: 1.1.0
>            Reporter: Bruce Schuchardt
>            Assignee: Bruce Schuchardt
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 2h
>  Remaining Estimate: 0h
>
> A test became deadlocked when a thread executing a query was requesting a PDX type ID from its server at the same time another thread was closing the cache.  I wrote a unit test to reproduce this problem.  Here is the deadlock:
>  
> {noformat}
> "ConnectionManagerJUnitTest thread":
> at org.apache.geode.cache.client.internal.pooling.PooledConnection.internalDestroy(PooledConnection.java:76)
> - waiting to lock <0x000000076bbc3d20> (a org.apache.geode.cache.client.internal.pooling.PooledConnection)
> at org.apache.geode.cache.client.internal.pooling.PooledConnection.internalClose(PooledConnection.java:101)
> at org.apache.geode.cache.client.internal.pooling.ConnectionManagerImpl$ConnectionMap.close(ConnectionManagerImpl.java:1164)
> - locked <0x000000076b848f30> (a org.apache.geode.cache.client.internal.pooling.ConnectionManagerImpl$ConnectionMap)
> at org.apache.geode.cache.client.internal.pooling.ConnectionManagerJUnitTest$3.run(ConnectionManagerJUnitTest.java:613)
> "main":
> at org.apache.geode.cache.client.internal.pooling.ConnectionManagerImpl$ConnectionMap.addConnection(ConnectionManagerImpl.java:1059)
> - waiting to lock <0x000000076b848f30> (a org.apache.geode.cache.client.internal.pooling.ConnectionManagerImpl$ConnectionMap)
> at org.apache.geode.cache.client.internal.pooling.ConnectionManagerImpl.addConnection(ConnectionManagerImpl.java:463)
> at org.apache.geode.cache.client.internal.pooling.ConnectionManagerImpl.borrowConnection(ConnectionManagerImpl.java:245)
> at org.apache.geode.cache.client.internal.pooling.ConnectionManagerJUnitTest.testThatMapCloseCausesCacheClosedException(ConnectionManagerJUnitTest.java:631)
> - locked <0x000000076bbc3d20> (a org.apache.geode.cache.client.internal.pooling.PooledConnection)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:498)
> at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
> at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
> at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
> at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
> at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
> at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
> at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
> at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
> at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
> at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
> at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
> at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
> at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
> at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
> at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
> at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
> at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
> at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
> at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
> at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
> {noformat}
> The "main" thread obtains a Connection and then, with its sync lock held, obtains another Connection to simulate the PDX registration.
> The background thread waits for the other thread to be ready and then closes the ConnectionMap.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)