Repository navigation
Conversation
The unlocked fast path in initializeHttpClient() could hand out a reference that a concurrent close() dropped to zero refs, leaving a new backend with a stopped HttpClient. Acquire (incref) and release (decref) now both happen under INIT_LOCK.
…s handle Nulling acquiredResourcesRef left request threads reading a field that could become null mid-request, and raced with the unsynchronized read in callTikaServer(). The handle is now final and double-close is guarded by a CAS instead.
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The concurrency fix needs regression coverage for simultaneous acquisition and closure.
Review effort: Balanced
Findings: 1
Open (1)
What changed in this PR
Fixes a race where Tika extraction backends could acquire a stopped shared HTTP client.
Changes:
- Synchronizes shared resource acquisition and release.
- Makes backend closure idempotent.
- Documents the fix in the changelog.
| File | Description |
|---|---|
TikaServerExtractionBackend.java |
Safely manages shared HTTP-client references. |
SOLR-18472-tikaserver-httpclient-refcount.yml |
Adds the changelog entry. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…race Race the last backend's close() against construction of a new backend and verify the new backend still completes a request, and check that calling close() twice does not tear down resources still in use.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

https://issues.apache.org/jira/browse/SOLR-18472
The fix is doing both incref and decref synchronized on the lock.
Code written by Claude Code Opus. Reviewed by Copilot. Fixed by Claude Fable. Reviewed by a Human™