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

ASF subversion and git services commented on SOLR-16203:
--------------------------------------------------------

Commit 61bc965f60d4cc3885f048db386104109ff5725a in solr's branch 
refs/heads/branch_9x from Jan Høydahl
[ https://gitbox.apache.org/repos/asf?p=solr.git;h=61bc965f60d ]

SOLR-16203: Initialize schema plugins loaded by SPI name (#2175)

(cherry picked from commit 8201bf81d79b638f281c3d075ba7c5e240ee9e08)


> Using SPI lookups of analysis components results in factories that don't get 
> ResourceLoaderAware.inform called on them (When using 
> ClassicIndexSchemaFactory)
> -------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: SOLR-16203
>                 URL: https://issues.apache.org/jira/browse/SOLR-16203
>             Project: Solr
>          Issue Type: Bug
>    Affects Versions: 9.0
>            Reporter: Chris M. Hostetter
>            Assignee: Jan Høydahl
>            Priority: Major
>         Attachments: SOLR-16203_test.patch
>
>          Time Spent: 2h 50m
>  Remaining Estimate: 0h
>
> Ok ... this is a weird one ...
> SOLR-13593 modified {{FieldTypePluginLoader}} to add the ability for analysis 
> Factories to be resolved by SPI name (ex: {{{}name="stop"{}}}, instead of by 
> "short class name" (ex: {{{}class="solr.StopFilterFactory"{}}}.
> The code that deals with this just calls (for example) 
> {{TokenFilterFactory.forName(name, params);}} and uses the resulting factory 
> "as is" – But these means that nothing calls the {{inform(ResourceLoader)}} 
> on any factories that implement {{ResourceLoaderAware}} (such as 
> {{StopFilterFactory}} or {{{}SynonymGraphFilterFactory{}}})
> In the "short class name" code path (the only option prior to 9.0), the 
> {{SolrResourceLoader}} is used to initialize the Factory, and 
> {{SolrResourceLoader..newInstance(...)}} takes responsibility of calling 
> {{factory.inform(this)}} on everything it instantiates that implements 
> {{ResourceLoaderAware}} (as well as some other checks: like 
> {{{}SolrCoreAware{}}})
> This discrepancy means that when using the {{name="foo"}} syntax, many 
> factories won't be fully initialized – or fail on invalid input – during 
> schema initialization. In the case of things like {{StopFilterFactory}} or 
> {{SynonymGraphFilterFactory}}) the problem will manifest as some type of 
> runtime error when the factory's {{create(...)}} method is called as part of 
> creating a new index or query Analyzer.
> ----
> _*...BUT...*_
> ----
> This problem only seems to manifest itself when using 
> {{ClassicIndexSchemaFactory}} -- which is why it's not readily apparent when 
> using the default configset, or something like {{bin/solr -e techproducts}} 
> (but is trivial to reproduce in testcases (since almost every "test" 
> solrconfig uses {{ClassicIndexSchemaFactory}})
> I have no idea _why_ using {{ManagedIndexSchemaFactory}} doesn't manifest the 
> same problem -- it should be using the same {{FieldTypePluginLoader}} under 
> the covers -- but clearly something specific to {{ManagedIndexSchema}} is 
> taking responsibility for calling {{ResourceLoaderAware.inform(...)}}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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

Reply via email to