[ 
https://issues.apache.org/jira/browse/LUCENE-8414?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16554508#comment-16554508
 ] 

ASF subversion and git services commented on LUCENE-8414:
---------------------------------------------------------

Commit d66c05ce4f9ebe107f9589007f6899681ce2444a in lucene-solr's branch 
refs/heads/master from [~dnhatn]
[ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=d66c05c ]

LUCENE-8414: Make segmentInfos private in IndexWriter

Today IW#SegmentInfos is package-private and can be accessed directly.
Unlike the production code which accesses the SegmentInfo with IW lock,
tests can access it without holding IW lock. This causes these tests
sometimes fail because they are checking an inconsistent view of
SegmentInfos due to a concurrent modification.

This commit makes SegmentInfos private in IndexWriter and ensures that
we snapshot SegmentInfos in our tests.


> CI fails TestIndexWriter#testSoftUpdateDocuments
> ------------------------------------------------
>
>                 Key: LUCENE-8414
>                 URL: https://issues.apache.org/jira/browse/LUCENE-8414
>             Project: Lucene - Core
>          Issue Type: Bug
>          Components: core/index
>    Affects Versions: master (8.0), 7.5
>            Reporter: Nhat Nguyen
>            Assignee: Simon Willnauer
>            Priority: Minor
>         Attachments: LUCENE-8414-unlucky-schedule.patch, LUCENE-8414.patch, 
> LUCENE-8414.patch
>
>
> Elastic CI found the following issue.
> {noformat}
> [junit4] Suite: org.apache.lucene.index.TestIndexWriter
> [junit4] 2> NOTE: reproduce with: ant test -Dtestcase=TestIndexWriter 
> -Dtests.method=testSoftUpdateDocuments -Dtests.seed=AA5B403FFC4459A5 
> -Dtests.slow=true -Dtests.badapples=true -Dtests.locale=fr-BE 
> -Dtests.timezone=Antarctica/Mawson -Dtests.asserts=true 
> -Dtests.file.encoding=ISO-8859-1
> [junit4] FAILURE 0.08s J1 | TestIndexWriter.testSoftUpdateDocuments <<<
> [junit4] > Throwable #1: java.lang.AssertionError: expected:<0> but was:<2>
> [junit4] > at 
> __randomizedtesting.SeedInfo.seed([AA5B403FFC4459A5:6F9256CD24240312]:0)
> [junit4] > at 
> org.apache.lucene.index.TestIndexWriter.testSoftUpdateDocuments(TestIndexWriter.java:3168)
> [junit4] > at java.lang.Thread.run(Thread.java:748)
> [junit4] 2> NOTE: leaving temporary files on disk at: 
> /var/lib/jenkins/workspace/apache+lucene-solr+branch_7x/lucene/build/core/test/J1/temp/lucene.index.TestIndexWriter_AA5B403FFC4459A5-001{noformat}
> I can reproduce this by mucking an unlucky schedule (see 
> unlucky-schedule.patch).



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to