Hi Atlassian Developer Community,
I would like to start a new thread/runnable in the my Jira DC App (it creates documents with apache-poi), but during reindexing I get the following error:
org.apache.lucene.store.AlreadyClosedException: FileLock invalidated by an external force: NativeFSLock(path=...)
Is this related to this issue? (NativeFSLockFactory loses the channel when a thread is interrupted and the SolrCore becomes unusable after [LUCENE-8262] · Issue #9309 · apache/lucene · GitHub)
How can it be avoided?
Here is what the runnable looks like, during which the error occurs:
public class XlsxRunnable implements Runnable {
@Override
public void run() {
JiraThreadLocalUtils.preCall();
try {
//...
} catch (Exception e) {
LOG.error("An error occurred during the job: ", e);
try {
//...
} catch (Exception exception) {
LOG.error("Delete job was failed!", exception);
}
} finally {
try {
//...
} catch (Exception exception) {
LOG.error("Finally error!", exception);
}
JiraThreadLocalUtils.postCall(LOG4J, null);
LOG.debug("Runnable finished. Thread: " + Thread.currentThread().getName());
}
}
}
This is what can be seen in the log:
1. [XlsxRunnable] An error occurred during the job:
java.io.IOException: Error on ZipFile /opt/atlassian/jira/temp/poifiles/...
Caused by: java.nio.channels.ClosedByInterruptException
...
2. [DefaultIndexEngine] Hit an exception committing writes to the index; discarding the current writer!
org.apache.lucene.store.AlreadyClosedException: FileLock invalidated by an external force: NativeFSLock(path=...)
Best regards,
Laci