<!-- 
RSS generated by JIRA (8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d) at Wed Feb 07 20:16:21 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>OpenDaylight JIRA</title>
    <link>https://jira.opendaylight.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>8.20.10</version>
        <build-number>820010</build-number>
        <build-date>22-06-2022</build-date>
    </build-info>


<item>
            <title>[NETCONF-967] YangLib: Unable to get schema SourceIdentifier</title>
                <link>https://jira.opendaylight.org/browse/NETCONF-967</link>
                <project id="10142" key="NETCONF">netconf</project>
                    <description>&lt;ol&gt;
	&lt;li&gt;run karaf&lt;/li&gt;
	&lt;li&gt;install odl-netconf-topology odl-restconf-nb odl-yanglib&lt;/li&gt;
	&lt;li&gt;connect testtool (it downloads its models to cache/schema)&lt;/li&gt;
	&lt;li&gt;try to access, for example: GET: &lt;a href=&quot;http://localhost:8181/yanglib/schemas/ietf-yang-types/2013-07-15&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://localhost:8181/yanglib/schemas/ietf-yang-types/2013-07-15&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;The requests fails with the error (see karaf.log). After restart the requests succeeds.&lt;/p&gt;</description>
                <environment></environment>
        <key id="36703">NETCONF-967</key>
            <summary>YangLib: Unable to get schema SourceIdentifier</summary>
                <type id="10104" iconUrl="https://jira.opendaylight.org/secure/viewavatar?size=xsmall&amp;avatarId=10303&amp;avatarType=issuetype">Bug</type>
                                            <priority id="3" iconUrl="https://jira.opendaylight.org/images/icons/priorities/major.svg">Medium</priority>
                        <status id="10003" iconUrl="https://jira.opendaylight.org/images/icons/status_generic.gif" description="">Confirmed</status>
                    <statusCategory id="2" key="new" colorName="blue-gray"/>
                                    <resolution id="-1">Unresolved</resolution>
                                        <assignee username="ivanhrasko">Ivan Hrasko</assignee>
                                    <reporter username="ivanhrasko">Ivan Hrasko</reporter>
                        <labels>
                            <label>pick-next</label>
                            <label>pt</label>
                    </labels>
                <created>Tue, 14 Feb 2023 07:32:45 +0000</created>
                <updated>Thu, 17 Aug 2023 08:09:40 +0000</updated>
                                                                                <due></due>
                            <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="72010" author="ivanhrasko" created="Wed, 15 Feb 2023 11:59:48 +0000"  >&lt;p&gt;The problem is that &lt;b&gt;YangLibProvider#schemaSourceRegistered()&lt;/b&gt; method is invoked only when:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
schemaListenerRegistration = schemaRepository.registerSchemaSourceListener(&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;);&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;is invoked. Currently this happens in &lt;b&gt;init()&lt;/b&gt; method.&lt;/p&gt;

&lt;p&gt;We can solve the issue similar way how its done in &lt;b&gt;DefaultSchemaResourceManager#getSchemaResources()&lt;/b&gt; where repository, listeners, etc. are registered on demand.&lt;/p&gt;</comment>
                            <comment id="72011" author="ivanhrasko" created="Wed, 15 Feb 2023 12:03:57 +0000"  >&lt;p&gt;Possible there are other problems:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;&lt;b&gt;YangLibProvider&lt;/b&gt; is not registered in &lt;b&gt;AbstractSchemaRepository&lt;/b&gt;&apos;s listeners field. In fact, its being registered but it looks that we have multiple &lt;b&gt;AbstractSchemaRepository&lt;/b&gt; instances running.&lt;/li&gt;
	&lt;li&gt;&lt;b&gt;AbstractSchemaSourceCache&lt;/b&gt;#&lt;b&gt;schemaSourceRegistered&lt;/b&gt; is being invoked when new files are added dring runtime - but the method does nothing with it.&lt;/li&gt;
&lt;/ul&gt;
</comment>
                            <comment id="72450" author="JIRAUSER13216" created="Wed, 16 Aug 2023 15:05:27 +0000"  >&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
schemaRepository = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; SharedSchemaRepository(&lt;span class=&quot;code-quote&quot;&gt;&quot;yang-library&quot;&lt;/span&gt;, parserFactory);
&lt;span class=&quot;code-keyword&quot;&gt;final&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; cache = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; FilesystemSchemaSourceCache&amp;lt;&amp;gt;(schemaRepository, YangTextSchemaSource.class,
    cacheFolderFile);
schemaRepository.registerSchemaSourceListener(cache);
schemaListenerRegistration = schemaRepository.registerSchemaSourceListener(&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;); &lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;ul&gt;
	&lt;li&gt;repository uses cache to access the data and to update the data&lt;/li&gt;
	&lt;li&gt;cache is filled on initialization using data from dir then never read&lt;/li&gt;
	&lt;li&gt;cache is a listener for repository, it means cache is only updated on repository event (which never occurs)&lt;/li&gt;
	&lt;li&gt;for yanglib to accept changes from testtool (assuming same dir usage)
	&lt;ul&gt;
		&lt;li&gt;these components have to share same repository instance&lt;/li&gt;
		&lt;li&gt;or cache functionality needs update to watch the directory changes&lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
&lt;/ul&gt;
</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10000">
                    <name>Blocks</name>
                                            <outwardlinks description="blocks">
                                        <issuelink>
            <issuekey id="36704">NETCONF-968</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                            <attachment id="18600" name="karaf.log" size="28390" author="ivanhrasko" created="Tue, 14 Feb 2023 07:36:37 +0000"/>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                            <customfield id="customfield_11400" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10000" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0|i044bz:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                </customfields>
    </item>
</channel>
</rss>