Skip to content

Fix(15831): Resolve race condition in ReferenceManager.doMaybeRefresh#15985

Open
vijaykriishna wants to merge 1 commit into
apache:mainfrom
vijaykriishna:fix/15831
Open

Fix(15831): Resolve race condition in ReferenceManager.doMaybeRefresh#15985
vijaykriishna wants to merge 1 commit into
apache:mainfrom
vijaykriishna:fix/15831

Conversation

@vijaykriishna
Copy link
Copy Markdown

Description

The key behavioral change is that with the loop in doMaybeRefresh(), a single call to maybeRefreshBlocking() will now refresh through multiple generations until the reference is fully up to date. This ensures that pending refreshes are not lost due to timing races.

Resolves #15831

Copy link
Copy Markdown
Contributor

@vigyasharma vigyasharma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look good, thanks @vijaykriishna !

Comment thread lucene/CHANGES.txt Outdated

* GITHUB#15939: Fix thread-safety issues with NFARunAutomaton. (Dimitris Rempapis)

* GITHUB#15831: Fixed a race condition in ReferenceManager.maybeRefresh() where refreshes could be missed if a new generation was flushed just before the refresh lock was released. (Vijay)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can go out with 10.5 I think. Let's move this entry to under the 10.5.0 section?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it only the entry in changes.txt, or the code change as well?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect @vigyasharma meant the code as well -- when we merge, we will cherry-pick to backport, or if that's conflicty, open a separate backport PR. Thanks @vijaykriishna, this is a good catch -- I'm curious how you caught this (the opened issue)?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @vijaykriishna : the changes entry for each contribution lives in the release version it's targeted for. It is helpful then, in the release process, to go over the CHANGES file and see what is getting released. Typically, you'll find that the changes file has two upcoming release sections, one for the next major version (11.0.0 right now) and one for the next minor version (10.5.0).

This change is backward compatible and doesn't break any APIs and can go in the next minor version release i.e. 10.5.0. So your changes entry will belong under the 10.5.0 header.

Copy link
Copy Markdown
Author

@vijaykriishna vijaykriishna May 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated CHANGES.txt to make sure the fix is targeted for 10.5.0. Please review. If the code change needs to be put into 10.5.0, branch_10x is the target branch I believe.

@github-actions github-actions Bot modified the milestones: 11.0.0, 10.5.0 May 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing a refresh is possible in ReferenceManager

3 participants