cloudant-labs / clouseau

Expose Lucene features as an erlang-like node
Apache License 2.0
58 stars 32 forks source link

fix: release leaked index write lock on failure when closing #78

Closed pgj closed 1 year ago

pgj commented 1 year ago

When a database is deleted, the corresponding directory structure is removed entirely, even if the index writer has not yet been closed. Due to the missing files, both attempts of closing the index and then rolling it back fail, which eventually leads to leak of resources, more specifically locks, due to a known bug in Lucene versions prior to 4.7.1. In result, the subsequent search requests to the same index will fail when recreated.

As a minimal approach, work around the problem by pulling out the reference to the write lock and release it.

pgj commented 1 year ago

Close this one in favor of #80.