{"action":"created","issue":{"url":"https://api.github.com/repos/neo4j/neo4j/issues/4957","labels_url":"https://api.github.com/repos/neo4j/neo4j/issues/4957/labels{/name}","comments_url":"https://api.github.com/repos/neo4j/neo4j/issues/4957/comments","events_url":"https://api.github.com/repos/neo4j/neo4j/issues/4957/events","html_url":"https://github.com/neo4j/neo4j/issues/4957","id":93305627,"number":4957,"title":"LuceneDataSource fails to release write lock when recovering from an unclean database shutdown in Neo4j embedded 2.2.2 and above","user":{"login":"cmorgner","id":311577,"avatar_url":"https://avatars.githubusercontent.com/u/311577?v=3","gravatar_id":"","url":"https://api.github.com/users/cmorgner","html_url":"https://github.com/cmorgner","followers_url":"https://api.github.com/users/cmorgner/followers","following_url":"https://api.github.com/users/cmorgner/following{/other_user}","gists_url":"https://api.github.com/users/cmorgner/gists{/gist_id}","starred_url":"https://api.github.com/users/cmorgner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cmorgner/subscriptions","organizations_url":"https://api.github.com/users/cmorgner/orgs","repos_url":"https://api.github.com/users/cmorgner/repos","events_url":"https://api.github.com/users/cmorgner/events{/privacy}","received_events_url":"https://api.github.com/users/cmorgner/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/neo4j/neo4j/labels/2.2","name":"2.2","color":"bfd4f2"},{"url":"https://api.github.com/repos/neo4j/neo4j/labels/kernel","name":"kernel","color":"0052cc"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-07-06T15:23:36Z","updated_at":"2015-07-06T21:44:56Z","closed_at":"2015-07-06T21:44:56Z","body":"Hi,\r\n\r\nwe're using Neo4j 2.2.3 embedded with several Lucene indexes that are created on startup. It seems that when the database is started again after an unclean shutdown (kill -9, system crash, etc.), the LuceneCommandApplier acquires a write lock on the data source in visitIndexDefineCommand(), but never releases the lock (it seems that the close() method is never called, verified by debugging).\r\n\r\nThe result of this issue is that the Lucene index is completely locked, no query can be executed until the system is shut down cleanly, and started again.\r\n\r\n\r\nI can confirm that the behavior is NOT present in 2.1.8, but in 2.2.2 and 2.2.3. I have not been able to create test code to reproduce the bug, because it seems to depend on more factors than just an unclean shutdown. It does not occur when using a minimal test setup with an embedded GraphDatabaseService and an index.\r\n\r\nHere is how we create our indexes, are we doing something wrong here?\r\n\r\n```\r\nfinal Index<Node> fulltextIndex = graphDb.index().forNodes(\"fulltextIndex\", LuceneIndexImplementation.FULLTEXT_CONFIG);\r\nfinal Index<Node> keywordIndex  = graphDb.index().forNodes(\"keywordIndex\", LuceneIndexImplementation.EXACT_CONFIG);\r\n```\r\n\r\nWe do not synchronize access to the index objects. Can that be a problem?\r\n\r\nThe messages.log does not contain any unusual messages.\r\n\r\nIt's not a blocker for us, but maybe there is a quick solution as this seems like a small bug.\r\n\r\nThank you and best regards,\r\nChristian Morgner\r\n\r\n/CC @amorgner"},"comment":{"url":"https://api.github.com/repos/neo4j/neo4j/issues/comments/119006064","html_url":"https://github.com/neo4j/neo4j/issues/4957#issuecomment-119006064","issue_url":"https://api.github.com/repos/neo4j/neo4j/issues/4957","id":119006064,"user":{"login":"cmorgner","id":311577,"avatar_url":"https://avatars.githubusercontent.com/u/311577?v=3","gravatar_id":"","url":"https://api.github.com/users/cmorgner","html_url":"https://github.com/cmorgner","followers_url":"https://api.github.com/users/cmorgner/followers","following_url":"https://api.github.com/users/cmorgner/following{/other_user}","gists_url":"https://api.github.com/users/cmorgner/gists{/gist_id}","starred_url":"https://api.github.com/users/cmorgner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cmorgner/subscriptions","organizations_url":"https://api.github.com/users/cmorgner/orgs","repos_url":"https://api.github.com/users/cmorgner/repos","events_url":"https://api.github.com/users/cmorgner/events{/privacy}","received_events_url":"https://api.github.com/users/cmorgner/received_events","type":"User","site_admin":false},"created_at":"2015-07-06T21:44:56Z","updated_at":"2015-07-06T21:44:56Z","body":"The issue is already fixed in commit c9596af0d990d7dde9a9053799b7295985ae3c05 from 10 days ago, thanks a lot! :)"}}