<!-- 
RSS generated by JIRA (8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d) at Wed Feb 07 20:46: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>[TSDR-88] Refactor/Simplify SyslogDatastoreManager</title>
                <link>https://jira.opendaylight.org/browse/TSDR-88</link>
                <project id="10179" key="TSDR">tsdr</project>
                    <description>&lt;p&gt;The SyslogDatastoreManager implements a mechanism for an external client to register a callback URL to be notified of syslog messages that pass a specified filter.&lt;/p&gt;

&lt;p&gt;Registration is done via a register-filter RPC. It generates a filter ID and writes a SyslogFilter list entry to the CONFIGURATION store. It also generates a listener ID and writes a Listener list entry under the SyslogFilter entry. A RegisteredListener instance is instantiated to listen for updates to the SyslogListener list entry in the OPERATIONAL store. When a syslog message is raised, if it passes the filter, the message text is written to the SyslogListener entry where, upon change notification, the RegisteredListener sends it to the callback URL.&lt;/p&gt;

&lt;p&gt;I don&apos;t know the original use case for this&#160;functionality and why it was added. Unfortunately the patch that added it, &lt;a href=&quot;https://git.opendaylight.org/gerrit/#/c/41711/20,&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://git.opendaylight.org/gerrit/#/c/41711/20,&lt;/a&gt;&#160;does not explain the reason.&#160;&#160;&lt;/p&gt;

&lt;p&gt;A few things I observed:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;I don&apos;t see the purpose of the Listener list under the SyslogFilter entry, ie why would there ever be multiple listeners sending to the same callback URL. Plus the way the code is structured, there&#160;is only ever one&#160;Listener entry.&lt;/li&gt;
	&lt;li&gt;The registration mechanism doesn&apos;t survive restarts since the RegisteredListener is instantiated via the RPC. So the external client woild need to detect that ODL restarted and re-register via the RPC. This would generate a new filter ID and a new SyslogFilter entry which could lead to a lot of stale entries over time.&lt;/li&gt;
	&lt;li&gt;I&apos;m not crazy about using the&#160;OPERATIONAL store as an intermediary to trigger delivery to the callback URL. It isn&apos;t intended for such a purpose and isn&apos;t efficient.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Assuming we want to keep&#160;this&#160;functionality, I propose we simplify it and make it work properly across restarts.&#160;Remove the listener lists from the yang model and simplify to:&lt;/p&gt;

&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;container syslog-dispatcher {
    list syslog-filter {
        config true;
        key &quot;filter-id&quot;;
        leaf filter-id {
            type string;
            description &quot;the unique ID of registered filter.&quot;;
        }
        container filter {
            uses meta-filter;
        }
        leaf callback-url {
            type string;
            description &quot;callback URL of your app.&quot;;
        }
 }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Eliminate the register and delete filter RPCs. Users can write syslog-filter entries to register. Add a DTCL for the syslog-filter list that caches the entries for quick retrieval. When a syslog message is raised, queue a thread task fo each registered filter to offload the notification.&lt;/p&gt;</description>
                <environment></environment>
        <key id="30772">TSDR-88</key>
            <summary>Refactor/Simplify SyslogDatastoreManager</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="tpantelis">Tom Pantelis</assignee>
                                    <reporter username="tpantelis">Tom Pantelis</reporter>
                        <labels>
                    </labels>
                <created>Wed, 19 Sep 2018 15:27:37 +0000</created>
                <updated>Wed, 3 Oct 2018 20:10:21 +0000</updated>
                            <resolved>Thu, 20 Sep 2018 12:22:00 +0000</resolved>
                                                                        <due></due>
                            <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="64994" author="tpantelis" created="Wed, 19 Sep 2018 17:51:02 +0000"  >&lt;p&gt;Patch &lt;a href=&quot;https://git.opendaylight.org/gerrit/#/c/76283/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://git.opendaylight.org/gerrit/#/c/76283/&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="65183" author="scottmelton" created="Wed, 3 Oct 2018 19:09:29 +0000"  >&lt;p&gt;I don&apos;t recall the use case for an external client to register a callback URL either.&#160; As you mention the code supports only one listener entry.&#160; I&apos;d guess the listener list was implemented for future development and can be simplified to contain only one, at least until we have a use case and modify the code to support it.&lt;/p&gt;

&lt;p&gt;Yes, I wouldn&apos;t be happy about using the OPERATIONAL datastore either. We should conform to how the different data stores are intended to be used. &#160; The implementors were probably unaware of that.&#160;&lt;/p&gt;

&lt;p&gt;Yes, the listener registration should be persisted.&#160; It doesn&apos;t make sense not to.&#160; I&apos;d bet it was needed just never implemented.&lt;/p&gt;

&lt;p&gt;That syslog-dispatcher container looks good, but I&apos;m not that familiar with it.&lt;/p&gt;

&lt;p&gt;Would adding a &quot;the&quot; to &quot;the unique ID of &quot;the&quot; registered filter.&quot; and spelling out application instead of the abbreviation app make them more readable?&lt;/p&gt;

&lt;p&gt;Maybe it&apos;s just me, but I think it is old school to shorten a DSL naming convention or descriptions when it isn&apos;t needed.&#160; I&apos;m finding the more complete a DSL the easier it is to learn. It also looks better to the untrained eye. &quot;app&quot; is a reasonable abbreviation in that context and wouldn&apos;t be confused with another word, but others can be ambiguous. Abbreviations also make the mind take extra step to guess or question at the intended word.&lt;/p&gt;</comment>
                            <comment id="65186" author="tpantelis" created="Wed, 3 Oct 2018 19:50:47 +0000"  >&lt;p&gt;I assume you referring to the yang descriptions. I didn&apos;t change any of those in my patch but I&apos;m sure they can be improved. Would you like to push a patch?  &lt;/p&gt;</comment>
                            <comment id="65187" author="scottmelton" created="Wed, 3 Oct 2018 20:10:21 +0000"  >&lt;p&gt;Ok, thought that was new.&#160; I would like to push many of those kinds of patches.&#160; Maybe I can get to the code cleanup, &lt;a href=&quot;https://jira.opendaylight.org/browse/TSDR-68&quot; title=&quot;Code cleanup&quot; class=&quot;issue-link&quot; data-issue-key=&quot;TSDR-68&quot;&gt;TSDR-68&lt;/a&gt; soon.&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|i03ixj:</customfieldvalue>

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