[jira] [Commented] (IGNITE-2528) Deadlocks caused by Ignite.close()
[ https://issues.apache.org/jira/browse/IGNITE-2528?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15290631#comment-15290631 ] Alexei Scherbakov commented on IGNITE-2528: --- Pull request https://github.com/apache/ignite/pull/730 > Deadlocks caused by Ignite.close() > -- > > Key: IGNITE-2528 > URL: https://issues.apache.org/jira/browse/IGNITE-2528 > Project: Ignite > Issue Type: Bug > Components: general >Affects Versions: 1.5.0.final >Reporter: Denis Magda >Assignee: Alexei Scherbakov > Fix For: 1.7 > > > If to start stopping an Ignite instance and execute {{cluster.nodes()}} from > an {{EntryProcessor}} or some other place of the code that holds a lock on > cache's gateway then this can lead to the deadlock: > Ignite.close: > - holds kernel.gateway lock; > - tries to get a gateway lock on cache A; > Entry.processor is called for cache A: > - a gateway lock is acquired for cache A; > - calling {{cluster.nodes()}}; > - trying to acquire kernel's gateway lock. > To fix this deadlock we can do the following: > - introduce a volatile variable that has to be set to 'true' when a node is > being stopped; > - check this variable before acquiring kernel's gateway. > Also probably it makes sense to try to use try lock here. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (IGNITE-2528) Deadlocks caused by Ignite.close()
[ https://issues.apache.org/jira/browse/IGNITE-2528?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15289098#comment-15289098 ] Alexei Scherbakov commented on IGNITE-2528: --- Patch available. Awaiting TC results. > Deadlocks caused by Ignite.close() > -- > > Key: IGNITE-2528 > URL: https://issues.apache.org/jira/browse/IGNITE-2528 > Project: Ignite > Issue Type: Bug > Components: general >Affects Versions: 1.5.0.final >Reporter: Denis Magda >Assignee: Alexei Scherbakov > Fix For: 1.7 > > > If to start stopping an Ignite instance and execute {{cluster.nodes()}} from > an {{EntryProcessor}} or some other place of the code that holds a lock on > cache's gateway then this can lead to the deadlock: > Ignite.close: > - holds kernel.gateway lock; > - tries to get a gateway lock on cache A; > Entry.processor is called for cache A: > - a gateway lock is acquired for cache A; > - calling {{cluster.nodes()}}; > - trying to acquire kernel's gateway lock. > To fix this deadlock we can do the following: > - introduce a volatile variable that has to be set to 'true' when a node is > being stopped; > - check this variable before acquiring kernel's gateway. > Also probably it makes sense to try to use try lock here. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (IGNITE-2528) Deadlocks caused by Ignite.close()
[ https://issues.apache.org/jira/browse/IGNITE-2528?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15284665#comment-15284665 ] Alexei Scherbakov commented on IGNITE-2528: --- Created a reproducer. > Deadlocks caused by Ignite.close() > -- > > Key: IGNITE-2528 > URL: https://issues.apache.org/jira/browse/IGNITE-2528 > Project: Ignite > Issue Type: Bug > Components: general >Affects Versions: 1.5.0.final >Reporter: Denis Magda >Assignee: Alexei Scherbakov > Fix For: 1.7 > > > If to start stopping an Ignite instance and execute {{cluster.nodes()}} from > an {{EntryProcessor}} or some other place of the code that holds a lock on > cache's gateway then this can lead to the deadlock: > Ignite.close: > - holds kernel.gateway lock; > - tries to get a gateway lock on cache A; > Entry.processor is called for cache A: > - a gateway lock is acquired for cache A; > - calling {{cluster.nodes()}}; > - trying to acquire kernel's gateway lock. > To fix this deadlock we can do the following: > - introduce a volatile variable that has to be set to 'true' when a node is > being stopped; > - check this variable before acquiring kernel's gateway. > Also probably it makes sense to try to use try lock here. -- This message was sent by Atlassian JIRA (v6.3.4#6332)