<!-- 
RSS generated by JIRA (8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d) at Wed Feb 07 20:02:01 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>[INFRAUTILS-8] JobCoordinator (ex-DataStoreJobCoordinator) job failures should indicate stack trace of original caller who submitted job</title>
                <link>https://jira.opendaylight.org/browse/INFRAUTILS-8</link>
                <project id="10129" key="INFRAUTILS">infrautils</project>
                    <description>&lt;p&gt;In order to better understand root causes of issues such as e.g. &lt;a href=&quot;https://jira.opendaylight.org/browse/GENIUS-58&quot; title=&quot;DataStoreJobCoordinator ModifiedNodeDoesNotExistException: Node /(urn:ietf:params:xml:ns:yang:ietf-interfaces?revision=2014-05-08)interfaces-state/interface does not exist. Cannot apply modification to its children.&quot; class=&quot;issue-link&quot; data-issue-key=&quot;GENIUS-58&quot;&gt;&lt;del&gt;GENIUS-58&lt;/del&gt;&lt;/a&gt; in the future, it would be useful if the JobCoordinator (ex-DataStoreJobCoordinator; about to be moved from genius to infrautils in &lt;a href=&quot;https://git.opendaylight.org/gerrit/#/c/51431/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://git.opendaylight.org/gerrit/#/c/51431/&lt;/a&gt;) for job failures should indicate stack trace of original caller who submitted job.&lt;/p&gt;

&lt;p&gt;NB: &lt;a href=&quot;https://bugs.opendaylight.org/show_bug.cgi?id=7917#c3&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://bugs.opendaylight.org/show_bug.cgi?id=7917#c3&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&quot;Adding appropriate info in the caller&apos;s mainWorker toString would help to identify the originator. However I think capturing the caller&apos;s stack trace would be too expensive in production although it could be done in a debug mode.&quot;&lt;/p&gt;

&lt;p&gt;I&apos;m wondering how other Java frameworks deal with not loosing the stack of the original caller when working with async lambdas in Java .. there must be some.. &quot;prior art&quot; in this domain?  Perhaps worth trying to learn a bit more about this through online research, before jumping into an implementation.&lt;/p&gt;</description>
                <environment>&lt;p&gt;Operating System: All&lt;br/&gt;
Platform: All&lt;/p&gt;</environment>
        <key id="19497">INFRAUTILS-8</key>
            <summary>JobCoordinator (ex-DataStoreJobCoordinator) job failures should indicate stack trace of original caller who submitted job</summary>
                <type id="10100" iconUrl="https://jira.opendaylight.org/secure/viewavatar?size=xsmall&amp;avatarId=10310&amp;avatarType=issuetype">Improvement</type>
                                                <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="10001">Won&apos;t Do</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="vorburger">Michael Vorburger</reporter>
                        <labels>
                    </labels>
                <created>Thu, 9 Mar 2017 14:04:04 +0000</created>
                <updated>Fri, 24 Sep 2021 14:35:55 +0000</updated>
                            <resolved>Fri, 24 Sep 2021 14:35:55 +0000</resolved>
                                    <version>(unspecified)</version>
                                                    <component>General</component>
                        <due></due>
                            <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="35390" author="vorburger" created="Thu, 9 Mar 2017 14:30:44 +0000"  >&lt;p&gt;&lt;a href=&quot;https://bugs.opendaylight.org/show_bug.cgi?id=7917#c5&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://bugs.opendaylight.org/show_bug.cgi?id=7917#c5&lt;/a&gt; :&lt;/p&gt;

&lt;p&gt;&amp;gt; The only way to capture caller identity is to capture it via a Throwable.&lt;br/&gt;
&amp;gt; That is going to hurt performance a &lt;b&gt;lot&lt;/b&gt;.&lt;/p&gt;

&lt;p&gt;&amp;gt; Clean way of achieving this is to route the failure back to the requestor &amp;#8211; &lt;br/&gt;
&amp;gt; which can then identify itself and provide any useful context.&lt;/p&gt;

&lt;p&gt;&amp;gt; I mean, at the end of the day, the requestor needs to know about the failure, right?&lt;/p&gt;

&lt;p&gt;Right... so the REAL problem here is that all the enqueueJob methods in the JobCoordinator (ex-DataStoreJobCoordinator) really instead of void should be returning a ListenableFuture that you can attach some sort of LoggingFutureCallback to (via Futures.addCallback), right?&lt;/p&gt;

&lt;p&gt;But if with this, you still wouldn&apos;t get a nice stack trace in a log, would you? You would just get an ERROR log from the Lambda you passed as the onFailure to the FutureCallback... so this, alone, still wouldn&apos;t actually solve the real problem I was after above, I believe.  Is there any solution to that?&lt;/p&gt;

&lt;p&gt;But returning Future from JobCoordinator enqueueJob would actually be very interesting for testability as well (it&apos;s something I&apos;ve been battling with for the component tests).&lt;/p&gt;

&lt;p&gt;Once &lt;a href=&quot;https://git.opendaylight.org/gerrit/#/c/51431/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://git.opendaylight.org/gerrit/#/c/51431/&lt;/a&gt; is in (I don&apos;t want to hold it back further), we probably should be changing &amp;amp; adding that then...&lt;/p&gt;</comment>
                            <comment id="35391" author="vorburger" created="Fri, 22 Sep 2017 14:22:48 +0000"  >&lt;p&gt;New &lt;a href=&quot;https://jira.opendaylight.org/browse/INFRAUTILS-16&quot; title=&quot;JobCoordinator enqueueJob must return a ListenableFuture instead of void&quot; class=&quot;issue-link&quot; data-issue-key=&quot;INFRAUTILS-16&quot;&gt;&lt;del&gt;INFRAUTILS-16&lt;/del&gt;&lt;/a&gt; opened for the return Future part; this issue for stack trace.&lt;/p&gt;</comment>
                            <comment id="35392" author="vorburger" created="Wed, 4 Oct 2017 23:14:12 +0000"  >&lt;p&gt;On further thought, I think (optionally, due to perf impact) capturing is a low priority, because e.g. in &lt;a href=&quot;https://jira.opendaylight.org/browse/GENIUS-58&quot; title=&quot;DataStoreJobCoordinator ModifiedNodeDoesNotExistException: Node /(urn:ietf:params:xml:ns:yang:ietf-interfaces?revision=2014-05-08)interfaces-state/interface does not exist. Cannot apply modification to its children.&quot; class=&quot;issue-link&quot; data-issue-key=&quot;GENIUS-58&quot;&gt;&lt;del&gt;GENIUS-58&lt;/del&gt;&lt;/a&gt; one &lt;b&gt;DOES&lt;/b&gt; actually get a clue of the origin - via the JobEntry mainWorker (it was InterfaceStateRemoveWorker, in that case).&lt;/p&gt;

&lt;p&gt;One thing we &lt;b&gt;ARE&lt;/b&gt; missing badly is context in case of thread death due to &quot;Thread terminated due to uncaught exception&quot; - such as in &lt;a href=&quot;https://jira.opendaylight.org/browse/NETVIRT-937&quot; title=&quot;DataStoreJobCoordinator java.lang.NullPointerException: at index 0&quot; class=&quot;issue-link&quot; data-issue-key=&quot;NETVIRT-937&quot;&gt;&lt;del&gt;NETVIRT-937&lt;/del&gt;&lt;/a&gt;... and I&apos;ve added that in &lt;a href=&quot;https://git.opendaylight.org/gerrit/#/c/63965/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://git.opendaylight.org/gerrit/#/c/63965/&lt;/a&gt;.&lt;/p&gt;</comment>
                            <comment id="69630" author="rovarga" created="Fri, 24 Sep 2021 14:35:55 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.opendaylight.org/browse/INFRAUTILS-75&quot; title=&quot;Remove jobcoordinator&quot; class=&quot;issue-link&quot; data-issue-key=&quot;INFRAUTILS-75&quot;&gt;&lt;del&gt;INFRAUTILS-75&lt;/del&gt;&lt;/a&gt; removed JobCoordinator, hence this is a non-issue.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10000">
                    <name>Blocks</name>
                                                                <inwardlinks description="is blocked by">
                                        <issuelink>
            <issuekey id="19505">INFRAUTILS-16</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <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_10208" key="com.atlassian.jira.plugin.system.customfieldtypes:textfield">
                        <customfieldname>External issue ID</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>7944</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10201" key="com.atlassian.jira.plugin.system.customfieldtypes:url">
                        <customfieldname>External issue URL</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[https://bugs.opendaylight.org/show_bug.cgi?id=7944]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10206" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Issue Type</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10305"><![CDATA[Improvement]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10202" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Priority</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10304"><![CDATA[Low]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10000" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0|i01mhb:</customfieldvalue>

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