Skip to content

fix: release Lucene lock before retry on corrupt index#8

Merged
fmaass merged 1 commit into
mainfrom
fix/lucene-lock-retry
Apr 9, 2026
Merged

fix: release Lucene lock before retry on corrupt index#8
fmaass merged 1 commit into
mainfrom
fix/lucene-lock-retry

Conversation

@fmaass
Copy link
Copy Markdown
Owner

@fmaass fmaass commented Apr 9, 2026

Summary

  • When initLucene() fails during CheckIndex, the IndexWriter already holds write.lock
  • The catch block deleted index files but never closed the writer/directory
  • Retry attempt hit LockObtainFailedException from the same JVM
  • Fix: close indexWriter and directory before deleting files and retrying

Test plan

  • Code review — change is isolated to error-recovery path
  • CI passes (no Java 21 locally)
  • Deploy to Saturn and verify no more Lucene lock errors on startup

When initLucene() fails during the CheckIndex step, the IndexWriter
already holds the write.lock. The catch block deleted index files but
never closed the writer, so the retry attempt hit
LockObtainFailedException from the same JVM.
@fmaass fmaass merged commit 549d50f into main Apr 9, 2026
@fmaass fmaass deleted the fix/lucene-lock-retry branch April 9, 2026 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant