[
https://issues.apache.org/jira/browse/SOLR-18135?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18118422#comment-18118422
]
Nick Shanin commented on SOLR-18135:
------------------------------------
Proposed fix in SolrIndexWriter.merge(): updateMergeMetrics is the only timer
start/stop. The catch no longer calls stop(), so a failed merge keeps its
original exception instead of AssertionError from RTimer.
Kevin offered this six months ago; the ticket is still open so I am sending a
small PR rather than scooping an in-flight patch.
Test: `:solr:core:test --tests org.apache.solr.update.SolrIndexMetricsTest`
> merge exception cause silently lost if assertions enabled; caused by double
> stop() of RTimer
> --------------------------------------------------------------------------------------------
>
> Key: SOLR-18135
> URL: https://issues.apache.org/jira/browse/SOLR-18135
> Project: Solr
> Issue Type: Bug
> Affects Versions: 10.0
> Reporter: Chris M. Hostetter
> Priority: Major
> Labels: pull-request-available
> Time Spent: 10m
> Remaining Estimate: 0h
>
> Found this in a downstream project unit test (with java assertions enabled)
> while testing out a Solr-10.0 RC....
> {noformat}
> 2> org.apache.lucene.index.MergePolicy$MergeException:
> java.lang.AssertionError
> 2> at __randomizedtesting.SeedInfo.seed([A6D71FE893244373]:0)
> 2> at
> org.apache.lucene.index.ConcurrentMergeScheduler.handleMergeException(ConcurrentMergeScheduler.java:764)
> 2> at
> org.apache.lucene.index.ConcurrentMergeScheduler$MergeThread.run(ConcurrentMergeScheduler.java:756)
> 2> Caused by: java.lang.AssertionError
> 2> at org.apache.solr.util.RTimer.stop(RTimer.java:84)
> 2> at
> org.apache.solr.metrics.otel.instruments.AttributedLongTimer$MetricTimer.stop(AttributedLongTimer.java:64)
> 2> at
> org.apache.solr.update.SolrIndexWriter.updateMergeMetrics(SolrIndexWriter.java:315)
> 2> at
> org.apache.solr.update.SolrIndexWriter.merge(SolrIndexWriter.java:225)
> 2> at
> org.apache.lucene.index.IndexWriter$IndexWriterMergeSource.merge(IndexWriter.java:6601)
> 2> at
> org.apache.lucene.index.ConcurrentMergeScheduler.doMerge(ConcurrentMergeScheduler.java:668)
> 2> at
> org.apache.lucene.index.ConcurrentMergeScheduler$MergeThread.run(ConcurrentMergeScheduler.java:729)
> {noformat}
> Based on the line numbers, what appears to be happening is:
> * {{SolrIndexSearcher.merge(...)}} catches some {{Throwable}} from either
> {{super.merge(...)}} or {{updateMergeMetrics(...,true,false, timer)}}
> ** {{SolrIndexSearcher.merge(...)}} catch block calls {{timer.stop()}}
> ** Then {{SolrIndexSearcher.merge(...)}} catch block calls
> {{updateMergeMetrics(...,true,true,timer)}}
> *** This causes {{updateMergeMetrics(...)}} to try to stop the timer again,
> tripping an assert in RTTimer
> * The {{AssertionError}} propogates up out of
> {{SolrIndexSearcher.merge(...)}}
> ** the original {{Throwable}} is lost
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]