noblepaul commented on a change in pull request #1804: URL: https://github.com/apache/lucene-solr/pull/1804#discussion_r480663558
########## File path: solr/core/src/java/org/apache/solr/schema/IndexSchema.java ########## @@ -190,10 +197,41 @@ public IndexSchema(String name, InputSource is, Version luceneVersion, SolrResou protected IndexSchema(Version luceneVersion, SolrResourceLoader loader, Properties substitutableProperties) { this.luceneVersion = Objects.requireNonNull(luceneVersion); this.loader = loader; - this.solrClassLoader = loader;//loader.getCore() == null? loader: loader.getCore().getSchemaPluginsLoader(); + this.solrClassLoader = createClassLoader(loader); this.substitutableProperties = substitutableProperties; } + private SolrClassLoader createClassLoader(SolrResourceLoader loader) { + if(loader.getCoreContainer() != null && loader.getSolrConfig() != null){ + return new PackageListeningClassLoader(loader.getCoreContainer(), loader, + pkg -> loader.getSolrConfig().maxPackageVersion(pkg), + () -> reloadCoreSchema()); + } + return loader; + } + + private void reloadCoreSchema() { + if(coreContainer != null) { + cores.forEach((coreName, id) -> { + try(SolrCore core = coreContainer.getCore(coreName, id)){ + if(core != null) { + core.fetchLatestSchema(); + } + } + }); + } + } Review comment: This happens only if you share the schema. If schema is not shared it only results in reloading schema in that one core ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org