We've observed an issue in SharedIndexWorkspaceImpl that appears to be a bug.
within
SharedIndexWorkspaceImpl#getIndexWriter()
SharedIndexWorkspaceImpl#getIndexWriter(ErrorContextBuilder errorContextBuilder)
The openWritersUsers is incremented before an IndexWriter is successfully obtained.
We are seeing a scenario with two separate jvms writing to the same index where one process holds a lock long enough to cause a locktimeout and the second process fails to obtain an IndexWriter (yet it still increments the openWritersUsers). Subsequent writes from the second process create a lock which is never closed due to openWriterUsers being > 0.
Our fix:
@Override
public IndexWriter getIndexWriter() {
synchronized ( lock ) {
IndexWriter indexWriter = super.getIndexWriter();
if(indexWriter != null) {
openWriterUsers++;
}
return indexWriter;
}
}
public IndexWriter getIndexWriter(ErrorContextBuilder errorContextBuilder) {
synchronized ( lock ) {
IndexWriter indexWriter = super.getIndexWriter( errorContextBuilder );
if(indexWriter != null) {
openWriterUsers++;
}
return indexWriter;
}
}
Thanks,
Tobias