<!-- 
RSS generated by JIRA (8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d) at Wed Feb 07 20:00:15 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>[GENIUS-236] Excessive toString in OvsdbNodeListener.getOvsdbTepInfo()</title>
                <link>https://jira.opendaylight.org/browse/GENIUS-236</link>
                <project id="10126" key="GENIUS">genius</project>
                    <description>&lt;p&gt;I&apos;m looking at a Java Flight Recording obtained from (internal) scale lab testing, and see extensive &quot;TLAB Allocations&quot; due to what appears to be a clear mistake causing excessive toString() usage in&#160;ITM&apos;s&#160;OvsdbNodeListener.getOvsdbTepInfo():&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-object&quot;&gt;char&lt;/span&gt;[] java.util.Arrays.copyOf(&lt;span class=&quot;code-object&quot;&gt;char&lt;/span&gt;[], &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;)	321
void java.lang.AbstractStringBuilder.ensureCapacityInternal(&lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;)	321
AbstractStringBuilder java.lang.AbstractStringBuilder.append(&lt;span class=&quot;code-object&quot;&gt;boolean&lt;/span&gt;)	243
StringBuilder java.lang.StringBuilder.append(&lt;span class=&quot;code-object&quot;&gt;boolean&lt;/span&gt;)	243
&lt;span class=&quot;code-object&quot;&gt;String&lt;/span&gt; org.opendaylight.genius.itm.commons.OvsdbTepInfo.toString()	243
OvsdbTepInfo org.opendaylight.genius.itm.listeners.OvsdbNodeListener.getOvsdbTepInfo(OvsdbNodeAugmentation)	243
void org.opendaylight.genius.itm.listeners.OvsdbNodeListener.update(Node, Node)	243
void org.opendaylight.genius.itm.listeners.OvsdbNodeListener.update(DataObject, DataObject)	243
void org.opendaylight.serviceutils.tools.mdsal.listener.DataTreeChangeListenerActions.update(InstanceIdentifier, DataObject, DataObject)	243
void org.opendaylight.serviceutils.tools.mdsal.listener.DataTreeChangeListenerActions.onDataTreeChanged(Collection, DataStoreMetrics)	243
void org.opendaylight.serviceutils.tools.mdsal.listener.AbstractSyncDataTreeChangeListener.onDataTreeChanged(Collection)	243
void org.opendaylight.controller.md.sal.binding.impl.BindingDOMDataTreeChangeListenerAdapter.onDataTreeChanged(Collection)	243
void org.opendaylight.controller.cluster.datastore.DataTreeChangeListenerActor.dataChanged(DataTreeChanged)	243
void org.opendaylight.controller.cluster.datastore.DataTreeChangeListenerActor.handleReceive(&lt;span class=&quot;code-object&quot;&gt;Object&lt;/span&gt;)	243
void org.opendaylight.controller.cluster.common.actor.AbstractUntypedActor.onReceive(&lt;span class=&quot;code-object&quot;&gt;Object&lt;/span&gt;)	243
&lt;span class=&quot;code-object&quot;&gt;Object&lt;/span&gt; akka.actor.UntypedActor$$anonfun$receive$1.applyOrElse(&lt;span class=&quot;code-object&quot;&gt;Object&lt;/span&gt;, Function1)	243
void akka.actor.Actor.aroundReceive(PartialFunction, &lt;span class=&quot;code-object&quot;&gt;Object&lt;/span&gt;)	243
void akka.actor.Actor.aroundReceive$(Actor, PartialFunction, &lt;span class=&quot;code-object&quot;&gt;Object&lt;/span&gt;)	243
void akka.actor.UntypedActor.aroundReceive(PartialFunction, &lt;span class=&quot;code-object&quot;&gt;Object&lt;/span&gt;)	243
void akka.actor.ActorCell.receiveMessage(&lt;span class=&quot;code-object&quot;&gt;Object&lt;/span&gt;)	243
void akka.actor.ActorCell.invoke(Envelope)	243
void akka.dispatch.Mailbox.processMailbox(&lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;, &lt;span class=&quot;code-object&quot;&gt;long&lt;/span&gt;)	243
void akka.dispatch.Mailbox.run()	243
&lt;span class=&quot;code-object&quot;&gt;boolean&lt;/span&gt; akka.dispatch.Mailbox.exec()	243
&lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; akka.dispatch.forkjoin.ForkJoinTask.doExec()	243
void akka.dispatch.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinTask)	243
void akka.dispatch.forkjoin.ForkJoinPool.runWorker(ForkJoinPool$WorkQueue)	243
void akka.dispatch.forkjoin.ForkJoinWorkerThread.run()	243&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
        <key id="31005">GENIUS-236</key>
            <summary>Excessive toString in OvsdbNodeListener.getOvsdbTepInfo()</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="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="tarun.t@altencalsoftlabs.com">TARUN THAKUR</assignee>
                                    <reporter username="vorburger">Michael Vorburger</reporter>
                        <labels>
                    </labels>
                <created>Mon, 12 Nov 2018 17:39:45 +0000</created>
                <updated>Thu, 15 Nov 2018 12:31:24 +0000</updated>
                            <resolved>Thu, 15 Nov 2018 12:31:24 +0000</resolved>
                                    <version>Oxygen-SR3</version>
                                    <fixVersion>Oxygen-SR4</fixVersion>
                                    <component>ITM</component>
                        <due></due>
                            <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="65664" author="tarunodlf" created="Thu, 15 Nov 2018 08:52:51 +0000"  >&lt;p&gt;Michael,&lt;/p&gt;

&lt;p&gt;I hope above issue is pointing to line &quot;&lt;font color=&quot;#660e7a&quot;&gt;LOG&lt;/font&gt;.trace(&lt;font color=&quot;#008000&quot;&gt;&quot;ovsdbTepInfo retrieved {}&quot;&lt;/font&gt;, ovsdbTepInfoObj);&quot; in OvsdbNodeListener.getOvsdbTepInfo()&lt;/p&gt;

&lt;p&gt;This is right that above method will be invoked every few seconds via update() method of OvsdbNodeListener that is why it may cause frequent TLAB allocation due to toString() calling on the object ovsdbTepInfoObj in the log message.&lt;/p&gt;

&lt;p&gt;As a solution, we may remove this log message because required paramters of ovsdbTepInfoObj are being printed at places where they are being used for performing TEP operations like add/remove in the ITM config DS.&lt;/p&gt;

&lt;p&gt;Please share your suggestion if it seems fine to you.&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;</comment>
                            <comment id="65665" author="tarunodlf" created="Thu, 15 Nov 2018 09:19:45 +0000"  >&lt;p&gt;Even, log message can be covered under if condition like below:&lt;/p&gt;

&lt;p&gt;&lt;b&gt;if&lt;/b&gt;&#160;(&lt;b&gt;&lt;em&gt;LOG&lt;/em&gt;&lt;/b&gt;.isTraceEnabled()) {&lt;br/&gt;
 &#160;&#160;&#160;&#160;&lt;b&gt;&lt;em&gt;LOG&lt;/em&gt;&lt;/b&gt;.trace(&lt;b&gt;&quot;ovsdbTepInfo retrieved {}&quot;&lt;/b&gt;, ovsdbTepInfoObj);&lt;br/&gt;
 }&lt;/p&gt;

&lt;p&gt;This can also solve problem as it is done at many places in Genius code.&lt;/p&gt;

&lt;p&gt;But, I feel that trace log message can be removed.&lt;/p&gt;</comment>
                            <comment id="65670" author="vorburger" created="Thu, 15 Nov 2018 11:22:11 +0000"  >&lt;p&gt;Tarun, if we look carefully at the exact stack trace above, we note:&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-object&quot;&gt;String&lt;/span&gt; org.opendaylight.genius.itm.commons.OvsdbTepInfo.toString()	243
OvsdbTepInfo org.opendaylight.genius.itm.listeners.OvsdbNodeListener.getOvsdbTepInfo(OvsdbNodeAugmentation)	243&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;This has Affects Version Oxygen, and indeed &lt;a href=&quot;https://github.com/opendaylight/genius/blob/stable/oxygen/itm/itm-impl/src/main/java/org/opendaylight/genius/itm/listeners/OvsdbNodeListener.java#L330&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;in Oxygen (only; already fixed in Fluorine &amp;amp; Neon) we had&lt;/a&gt;:&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;
LOG.trace(&lt;span class=&quot;code-quote&quot;&gt;&quot;{}&quot;&lt;/span&gt;, ovsdbTepInfoObj.toString());&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;which is very bad and what caused this; I&apos;ve just fixed it in &lt;a href=&quot;https://git.opendaylight.org/gerrit/#/c/77850/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;c/77850&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;FYI there is &lt;a href=&quot;https://wiki.opendaylight.org/view/BestPractices/Logging_Best_Practices#Do_NOT.2C_in_general.2C_use_isTrace.2F.2FDebug.2FInfo.2FWarn.2FErrorEnabled.28.29&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;normally no need to use isTraceEnabled&lt;/a&gt;(), because LOG.trace() is already fast enough, and only does the toString() on arguments if that level is emabled. That is unless in the LOG statement you do something that has some cost to calculate (i.e. don&apos;t just pass an object reference), then you need isXXXEnabled. The linked Wiki page explains this more; hope that helps.&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </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|i03kc7:</customfieldvalue>

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