<!-- 
RSS generated by JIRA (8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d) at Wed Feb 07 20:55:10 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>[YANGTOOLS-1094] Taking more than 10mins when parsing YANG models</title>
                <link>https://jira.opendaylight.org/browse/YANGTOOLS-1094</link>
                <project id="10188" key="YANGTOOLS">yangtools</project>
                    <description>&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;Recently, we have a time consuming issue when parsing 120+ YANG models with ODL yang tools version 3.0.5, it takes more than 10 mins.&lt;/p&gt;

&lt;p&gt;Let me try to describe the steps reproducing this issue.&lt;br/&gt;
1.Download all YANG models from server, and writing them to files.&lt;br/&gt;
2.Feed all YANG models files to ODL, we called the following API.&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;
parseSources(StatementParserMode.DEFAULT_MODE, &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;,files.stream().map(YangTextSchemaSource::forFile).collect(Collectors.toList()))
&lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; SchemaContext parseSources(&lt;span class=&quot;code-keyword&quot;&gt;final&lt;/span&gt; StatementParserMode parserMode, &lt;span class=&quot;code-keyword&quot;&gt;final&lt;/span&gt; Set&amp;lt;QName&amp;gt; supportedFeatures,
 &lt;span class=&quot;code-keyword&quot;&gt;final&lt;/span&gt; Collection&amp;lt;? &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; SchemaSourceRepresentation&amp;gt; sources) &lt;span class=&quot;code-keyword&quot;&gt;throws&lt;/span&gt; YangParserException, IOException {
 YangParserFactory factory = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; YangParserFactoryImpl();
 &lt;span class=&quot;code-keyword&quot;&gt;final&lt;/span&gt; YangParser parser = factory.createParser(parserMode);
 &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (supportedFeatures != &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;) {
 parser.setSupportedFeatures(supportedFeatures);
 }
 parser.addSources(sources);
 &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; parser.buildSchemaContext();
 }&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;I checked the ODL source code in deeper, main code snippet as below:&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;
&lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; (&lt;span class=&quot;code-keyword&quot;&gt;final&lt;/span&gt; ModelProcessingPhase phase : PHASE_EXECUTION_ORDER) {
 startPhase(phase);
 loadPhaseStatements();
 completePhaseActions();
 endPhase(phase);
 }&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Main problems happened in last phase ModelProcessingPhase.EFFECTIVE_MODEL marked by red , I tried to extract main logs and see the last phase takes more than 10 mins.&lt;/p&gt;

&lt;p&gt;&lt;font color=&quot;#4c9aff&quot;&gt;2020-03-19T08:05:54,275&lt;/font&gt; DEBUG&#160; Global phase SOURCE_PRE_LINKAGE started&lt;/p&gt;

&lt;p&gt;&#8230;&lt;/p&gt;

&lt;p&gt;&lt;font color=&quot;#4c9aff&quot;&gt;2020-03-19T08:06:14,994&lt;/font&gt; DEBUG&#160; Global phase SOURCE_PRE_LINKAGE finished&lt;/p&gt;

&lt;p&gt;&lt;font color=&quot;#57d9a3&quot;&gt;2020-03-19T08:06:16,691&lt;/font&gt; DEBUG&#160; Global phase SOURCE_LINKAGE started&lt;/p&gt;

&lt;p&gt;&#8230;&lt;/p&gt;

&lt;p&gt;&lt;font color=&quot;#57d9a3&quot;&gt;2020-03-19T08:06:39,595&lt;/font&gt; DEBUG&#160; Global phase SOURCE_LINKAGE finished&lt;/p&gt;

&lt;p&gt;&lt;font color=&quot;#ffab00&quot;&gt;2020-03-19T08:06:41,549&lt;/font&gt; DEBUG&#160; Global phase STATEMENT_DEFINITION started&lt;/p&gt;

&lt;p&gt;&#8230;&lt;/p&gt;

&lt;p&gt;&lt;font color=&quot;#ffab00&quot;&gt;2020-03-19T08:06:45,642&lt;/font&gt; DEBUG&#160; Global phase STATEMENT_DEFINITION finished&lt;/p&gt;

&lt;p&gt;&lt;font color=&quot;#0747a6&quot;&gt;2020-03-19T08:06:47,325&lt;/font&gt; DEBUG&#160; Global phase FULL_DECLARATION started&lt;/p&gt;

&lt;p&gt;&#8230;&lt;/p&gt;

&lt;p&gt;&lt;font color=&quot;#0747a6&quot;&gt;2020-03-19T08:08:42,069&lt;/font&gt; DEBUG&#160; Global phase FULL_DECLARATION finished&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;&lt;font color=&quot;#de350b&quot;&gt;2020-03-19T08:08:43,726&lt;/font&gt; DEBUG&#160; Global phase EFFECTIVE_MODEL started&lt;/p&gt;

&lt;p&gt;&#8230;&lt;/p&gt;

&lt;p&gt;&lt;font color=&quot;#de350b&quot;&gt;2020-03-19T08:19:34,745&lt;/font&gt; DEBUG&#160; Global phase EFFECTIVE_MODEL finished&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;Meanwhile, I also run unit test for YANG parser method at the same environment, it is weird that unit test running is quite fast.&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;Also,stack trace tree of runtime is attached for your reference. &lt;span class=&quot;image-wrap&quot; style=&quot;&quot;&gt;&lt;img src=&quot;https://jira.opendaylight.org/secure/attachment/15629/15629_yangparser.png&quot; style=&quot;border: 0px solid black&quot; /&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;We are blocked by this issue for a long time,could you please help look into it with high priority?&lt;/p&gt;

&lt;p&gt;Thanks&lt;/p&gt;</description>
                <environment>&lt;p&gt;Runtime environment information:&lt;br/&gt;
&lt;b&gt;JVM Version&lt;/b&gt;:Java HotSpot(TM) 64-Bit Server VM (25.121-b13) for linux-amd64 JRE (1.8.0_121-b13)&lt;br/&gt;
&lt;b&gt;Numbers of core of CPU&lt;/b&gt;:8&lt;br/&gt;
&lt;b&gt;Total physical memory size&lt;/b&gt;:63.05G&lt;br/&gt;
&lt;b&gt;OS version&lt;/b&gt;:uname:Linux 3.0.101-94-default #1 SMP Thu Jan 26 12:20:59 UTC 2017 (c499ea8) x86_64&lt;/p&gt;</environment>
        <key id="32560">YANGTOOLS-1094</key>
            <summary>Taking more than 10mins when parsing YANG models</summary>
                <type id="10104" iconUrl="https://jira.opendaylight.org/secure/viewavatar?size=xsmall&amp;avatarId=10303&amp;avatarType=issuetype">Bug</type>
                                            <priority id="2" iconUrl="https://jira.opendaylight.org/images/icons/priorities/critical.svg">High</priority>
                        <status id="5" iconUrl="https://jira.opendaylight.org/images/icons/statuses/resolved.png" description="A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.">Resolved</status>
                    <statusCategory id="3" key="done" colorName="green"/>
                                    <resolution id="10000">Done</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="clark-lin">Clark Lin</reporter>
                        <labels>
                    </labels>
                <created>Tue, 7 Apr 2020 14:09:30 +0000</created>
                <updated>Wed, 8 Apr 2020 09:29:14 +0000</updated>
                            <resolved>Wed, 8 Apr 2020 09:29:14 +0000</resolved>
                                    <version>3.0.5</version>
                    <version>2.1.18</version>
                                                    <component>parser</component>
                        <due></due>
                            <votes>0</votes>
                                    <watches>1</watches>
                                                                                                                <comments>
                            <comment id="68012" author="JIRAUSER12920" created="Wed, 8 Apr 2020 09:29:14 +0000"  >&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;This is due to huge parse models logs needs to be written to disk, which called synchronized methods and then takes much more time, so we decided to turn off parse logs, then this issue goes away.&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                            <attachment id="15629" name="yangparser.png" size="25890" author="clark-lin" created="Tue, 7 Apr 2020 14:06:33 +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|i03ruv:</customfieldvalue>

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