Skip to content

SOLR-5754: StreamingSolrClients.getErrors() returns a snapshot copy instead of the live list - #5073

Open
nick-boss-tech wants to merge 7 commits into
apache:mainfrom
nick-boss-tech:solr-5754-submit
Open

nick-boss-tech wants to merge 7 commits into
apache:mainfrom
nick-boss-tech:solr-5754-submit

Conversation

@nick-boss-tech

@nick-boss-tech nick-boss-tech commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

🤖 AI text below 🤖 (posted on behalf of Nick Shanin)

https://issues.apache.org/jira/browse/SOLR-5754

What happens today

The retry pass reads the errors, then clears the list in a second call. An error added in between can be cleared without a retry.

Before this change, the retry pass copied the live error list and cleared it later in the same method. An error added between those two steps was cleared unseen. On the paths read, that window does not open, so this change is hardening, not a fix for a reproduced bug.

What this change does

Errors are read as a snapshot, and the retry pass takes them with one atomic drain.

Proof

The combined run passed on a merged tree. There is no separate run without the fix for this branch; it was tested on the combined tree.

  • Combined run, 2026-10-08, at head 7fbe0128d8b0: 26 of 26 tests pass, on a local merge commit of SOLR-5939 and this change, 1ddbf36202d, whose tree is f2e33340f0ea.
  • Focused: TestTolerantUpdateProcessorCloud 19/19 and TestTolerantUpdateProcessorRandomCloud 2/2. The module checks pass.
  • The current head 4bdf281d3cb3 removes only the root SOLR-5754-TESTING.md file, a note that is not part of the change; that removal was checked directly.
  • StreamingSolrClientsTest has testGetErrorsIsASnapshot and testDrainErrorsReturnsAndClears. It passed 2 of 2 in the same combined run. It skips itself when Mockito cannot mock (L29-L32).

Limits

This is hardening. The race is not reproduced, and the tests are single-threaded.

  • On the paths read, no runner thread adds an error during the retry window. This was checked by reading, not by a run.
  • The tests check snapshot and drain behavior. They do not exercise the concurrent window. A follow-up submission is planned to test that window.
  • clearErrors() stays public and has no caller in main code. This change does not remove it.
  • SOLR-5939 changes the same two files. The textual merge is clean, and the proof above covers the merged tree.

Changelog: changelog/unreleased/SOLR-5754-streaming-clients-error-snapshot.yml (type: changed).

AI assistance

AI agents assisted with research, implementation, review, and drafting. Nick Shanin directed the work and takes responsibility for this contribution.

@nick-boss-tech nick-boss-tech changed the title SOLR-5754: SolrStreamingServers returns a synchronizedList of Errors. SOLR-5754: StreamingSolrClients.getErrors() returns a snapshot copy instead of the live list Oct 9, 2026
@nick-boss-tech
nick-boss-tech marked this pull request as ready for review October 9, 2026 23:25
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.

1 participant