Port trivial production fixes from Lucene 4.8.1, #1381 Batch 1#1413
Open
paulirwin wants to merge 8 commits into
Open
Port trivial production fixes from Lucene 4.8.1, #1381 Batch 1#1413paulirwin wants to merge 8 commits into
paulirwin wants to merge 8 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Backports a first batch of small but production-relevant Lucene 4.8.1 fixes into Lucene.Net, focusing on correctness around merging, docvalues resource handling, token stream lifecycle, and thread coordination, plus adding a regression test for the TieredMergePolicy change.
Changes:
- Hardened and corrected several production code paths (token stream reset handling, docvalues producer ref-count/leak behavior, merge “over budget” selection, and thread wakeups).
- Added an argument-range guard to
OfflineSorter.ByteSequencesWriter.Write()to prevent invalidshortlength truncation. - Added a new TieredMergePolicy regression test for LUCENE-5668.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Lucene.Net/Util/OfflineSorter.cs | Adds len > short.MaxValue guard before writing length as short. |
| src/Lucene.Net/Index/TieredMergePolicy.cs | Fixes LUCENE-5668 by adjusting the “over budget” eligibility threshold. |
| src/Lucene.Net/Index/SegmentReader.cs | Prevents docvalues producer reference leaks by tracking gens only after successful producer creation. |
| src/Lucene.Net/Index/DocumentsWriterPerThreadPool.cs | Ensures waiting threads are woken after deactivating unreleased thread states. |
| src/Lucene.Net/Index/DocInverterPerField.cs | Moves TokenStream.Reset() into the try so failures are handled and the stream is properly closed. |
| src/Lucene.Net.Tests/Index/TestTieredMergePolicy.cs | Adds TestUnbalancedMergeSelection() for LUCENE-5668. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This was referenced Jul 12, 2026
Contributor
Author
|
The OfflineSorter changes were reverted and moved to #1422. |
Some work already done; others deferred for issue apache#1381 batch 5.
…oming in batch 5)
Only including the PulseAll in this change; the rest will be in batch 5)
paulirwin
force-pushed
the
issue/1381-batch-1
branch
from
July 15, 2026 17:29
dd44294 to
aa17acb
Compare
4 tasks
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.
Backport trivial production fixes from Lucene 4.8.1
Partial #1381 (Batch 1)
Description
stream.Reset()into thetryblockPulseAllcall toDeactivateUnreleasedStatesNote that the partial items will be fully completed in Batch 5.