<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic tStatCatcher statistics causing nullpointerexception within parallel execution (it uses HashMap within Threads) in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/tStatCatcher-statistics-causing-nullpointerexception-within/m-p/2269325#M47613</link>
    <description>&lt;P&gt;I'm finding that some of my talend DI jobs are failing with a nullpointerexception at random times. Looking a the line of code failing, it is the tStatCatcher addMessage method being called to record the duration of the job, like the following example:&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;PRE&gt;tStatCatcher_1.addMessage("end","tFileTouch_4", end_Hash.get("tFileTouch_4")-start_Hash.get("tFileTouch_4"));&lt;/PRE&gt; 
&lt;P&gt;This only happens on components that happen to be within a parallel executed iteration flow (e.g. I'm running four at a time )&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;e.g.&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 400px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M1tp.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/156883i4A1F253A8506659D/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M1tp.png" alt="0683p000009M1tp.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I capture the exception as part of the tStatCatcher framework&lt;/P&gt; 
&lt;P&gt;This is the exception message:&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;PRE&gt;java.lang.RuntimeException:Child job running failed.
java.lang.NullPointerException
at reporting_etl.etl_con_job_0_1.etl_con_job$1tFileTouch_4Thread.run(etl_con_job.java:6737)
at routines.system.ThreadPoolWorker.runIt(TalendThreadPool.java:159)
at routines.system.ThreadPoolWorker.runWork(TalendThreadPool.java:150)
at routines.system.ThreadPoolWorker.access$0(TalendThreadPool.java:145)
at routines.system.ThreadPoolWorker$1.run(TalendThreadPool.java:122)
at java.lang.Thread.run(Thread.java:745)&lt;/PRE&gt; 
&lt;P&gt;line 6737 is that addMessage method call above&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I've noticed that Talend use a HashMap for putting and getting tStatCatcher messages, which is not thread safe and as this is in a parallel execution (threaded) then I'm assuming that it's a threading issue with the Talend Generated code, this combined with the fact that it is randomly happening leads me to believe that they should be using a Concurrent HashMap.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Does anyone have any advice on what I can do here, shall I raise a bug, or is there a work around for this?&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Kind regards&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 03 Jan 2019 10:31:39 GMT</pubDate>
    <dc:creator>ekilby</dc:creator>
    <dc:date>2019-01-03T10:31:39Z</dc:date>
    <item>
      <title>tStatCatcher statistics causing nullpointerexception within parallel execution (it uses HashMap within Threads)</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tStatCatcher-statistics-causing-nullpointerexception-within/m-p/2269325#M47613</link>
      <description>&lt;P&gt;I'm finding that some of my talend DI jobs are failing with a nullpointerexception at random times. Looking a the line of code failing, it is the tStatCatcher addMessage method being called to record the duration of the job, like the following example:&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;PRE&gt;tStatCatcher_1.addMessage("end","tFileTouch_4", end_Hash.get("tFileTouch_4")-start_Hash.get("tFileTouch_4"));&lt;/PRE&gt; 
&lt;P&gt;This only happens on components that happen to be within a parallel executed iteration flow (e.g. I'm running four at a time )&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;e.g.&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 400px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M1tp.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/156883i4A1F253A8506659D/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M1tp.png" alt="0683p000009M1tp.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I capture the exception as part of the tStatCatcher framework&lt;/P&gt; 
&lt;P&gt;This is the exception message:&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;PRE&gt;java.lang.RuntimeException:Child job running failed.
java.lang.NullPointerException
at reporting_etl.etl_con_job_0_1.etl_con_job$1tFileTouch_4Thread.run(etl_con_job.java:6737)
at routines.system.ThreadPoolWorker.runIt(TalendThreadPool.java:159)
at routines.system.ThreadPoolWorker.runWork(TalendThreadPool.java:150)
at routines.system.ThreadPoolWorker.access$0(TalendThreadPool.java:145)
at routines.system.ThreadPoolWorker$1.run(TalendThreadPool.java:122)
at java.lang.Thread.run(Thread.java:745)&lt;/PRE&gt; 
&lt;P&gt;line 6737 is that addMessage method call above&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I've noticed that Talend use a HashMap for putting and getting tStatCatcher messages, which is not thread safe and as this is in a parallel execution (threaded) then I'm assuming that it's a threading issue with the Talend Generated code, this combined with the fact that it is randomly happening leads me to believe that they should be using a Concurrent HashMap.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Does anyone have any advice on what I can do here, shall I raise a bug, or is there a work around for this?&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Kind regards&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Jan 2019 10:31:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tStatCatcher-statistics-causing-nullpointerexception-within/m-p/2269325#M47613</guid>
      <dc:creator>ekilby</dc:creator>
      <dc:date>2019-01-03T10:31:39Z</dc:date>
    </item>
    <item>
      <title>Re: tStatCatcher statistics causing nullpointerexception within parallel execution (it uses HashMap within Threads)</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tStatCatcher-statistics-causing-nullpointerexception-within/m-p/2269326#M47614</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;Could you please clarify in which Talend version/edition you are?&lt;/P&gt;
&lt;P&gt;Best regards&lt;/P&gt;
&lt;P&gt;Sabrina&lt;/P&gt;</description>
      <pubDate>Fri, 04 Jan 2019 08:12:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tStatCatcher-statistics-causing-nullpointerexception-within/m-p/2269326#M47614</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-01-04T08:12:54Z</dc:date>
    </item>
    <item>
      <title>Re: tStatCatcher statistics causing nullpointerexception within parallel execution (it uses HashMap within Threads)</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tStatCatcher-statistics-causing-nullpointerexception-within/m-p/2269327#M47615</link>
      <description>&lt;P&gt;Hi, I'm using&amp;nbsp;&lt;/P&gt;&lt;P&gt;Talend Open Studio for Data Integration&lt;/P&gt;&lt;P&gt;Version: 6.4.1&lt;/P&gt;</description>
      <pubDate>Fri, 04 Jan 2019 08:58:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tStatCatcher-statistics-causing-nullpointerexception-within/m-p/2269327#M47615</guid>
      <dc:creator>ekilby</dc:creator>
      <dc:date>2019-01-04T08:58:41Z</dc:date>
    </item>
  </channel>
</rss>

