<!-- 
RSS generated by JIRA (8.3.4#803005-sha1:1f96e09b3c60279a408a2ae47be3c745f571388b) at Sat Feb 10 16:32:42 JST 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>PFS-JIRA</title>
    <link>https://pfspipe.ipmu.jp/jira</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>8.3.4</version>
        <build-number>803005</build-number>
        <build-date>13-09-2019</build-date>
    </build-info>


<item>
            <title>[INSTRM-1180] ingest using shell call to ingestPfsImages</title>
                <link>https://pfspipe.ipmu.jp/jira/browse/INSTRM-1180</link>
                <project id="10300" key="INSTRM">Instrument control development</project>
                    <description>&lt;p&gt;We currently ingesting using a Task. Switch to a call to ingestPfsImages. &lt;/p&gt;

&lt;p&gt;Hoping to make new file processing faster and less prone to registry failures.&lt;/p&gt;</description>
                <environment></environment>
        <key id="15275">INSTRM-1180</key>
            <summary>ingest using shell call to ingestPfsImages</summary>
                <type id="3" iconUrl="https://pfspipe.ipmu.jp/jira/secure/viewavatar?size=xsmall&amp;avatarId=10518&amp;avatarType=issuetype">Task</type>
                                            <priority id="10000" iconUrl="https://pfspipe.ipmu.jp/jira/images/icons/priorities/medium.svg">Normal</priority>
                        <status id="10002" iconUrl="https://pfspipe.ipmu.jp/jira/images/icons/statuses/generic.png" description="The issue is resolved, reviewed, and merged">Done</status>
                    <statusCategory id="3" key="done" colorName="green"/>
                                    <resolution id="10000">Done</resolution>
                                        <assignee username="cloomis">cloomis</assignee>
                                    <reporter username="cloomis">cloomis</reporter>
                        <labels>
                    </labels>
                <created>Fri, 12 Feb 2021 17:16:08 +0000</created>
                <updated>Mon, 15 Feb 2021 17:30:22 +0000</updated>
                            <resolved>Mon, 15 Feb 2021 17:30:22 +0000</resolved>
                                                                    <component>ics_drpActor</component>
                        <due></due>
                            <votes>0</votes>
                                    <watches>2</watches>
                                                                <comments>
                            <comment id="18487" author="cloomis" created="Sat, 13 Feb 2021 17:58:32 +0000"  >&lt;p&gt;Doesn&apos;t really help. Delay Is dependent on the size of the registry, so we do have to figure this out. Not obvious that the copy-update-rename hack fixed by the DM ticket is the problem, as much as I hate and want to blame that. Does seem to be at least partially tied up with a sequential scan of the db right before closing. More to come.&lt;/p&gt;</comment>
                            <comment id="18492" author="cloomis" created="Sun, 14 Feb 2021 04:43:46 +0000"  >&lt;p&gt;Good news: ingest really does take long time due to a fixable obs_pfs problem updating the &lt;tt&gt;raw_visit&lt;/tt&gt; table. &lt;a href=&quot;https://pfspipe.ipmu.jp/jira/browse/PIPE2D-715&quot; title=&quot;Remove updates to raw_visit table from ingestPfsImages.py&quot; class=&quot;issue-link&quot; data-issue-key=&quot;PIPE2D-715&quot;&gt;&lt;del&gt;PIPE2D-715&lt;/del&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Bad news: the drpActor does have associated sequencing problems which still need to be addressed.  But I think addressing those will either take care of &lt;a href=&quot;https://pfspipe.ipmu.jp/jira/browse/INSTRM-1075&quot; title=&quot;drpActor still hangs&quot; class=&quot;issue-link&quot; data-issue-key=&quot;INSTRM-1075&quot;&gt;&lt;del&gt;INSTRM-1075&lt;/del&gt;&lt;/a&gt; or at least make things less confusing.&lt;/p&gt;</comment>
                            <comment id="18495" author="arnaud.lefur" created="Sun, 14 Feb 2021 12:25:11 +0000"  >&lt;p&gt;Great, it used to be ~atomic, so that makes sense.&lt;br/&gt;
Yeah, basically the command thread is the bottleneck, as a result ingest + detrend are done sequentially.&lt;br/&gt;
I though it was safer to avoid dealing with threads, especially with DB behind the scene.&lt;br/&gt;
We still want to make sure that detrend is fired once after all files are ingested right ?&lt;/p&gt;</comment>
                            <comment id="18501" author="cloomis" created="Mon, 15 Feb 2021 04:47:50 +0000"  >&lt;p&gt;This is still a mess. I am running &lt;tt&gt;obs_pfs cpl&lt;/tt&gt; on top of &lt;tt&gt;pfs_pipe2d w.2021.06b&lt;/tt&gt;, which disables the &lt;tt&gt;raw_visit&lt;/tt&gt; updates which cause ingest to slow down to 10s of seconds (everywhere, not just on shell2-ics). There may still be gains to be made on ingest.&lt;/p&gt;

&lt;p&gt;I re-ordered the internal processing of ingest&amp;amp;detrend in order to guarantee that only one operation is running at a time.&lt;/p&gt;

&lt;p&gt;Added &lt;tt&gt;isr.doDefect=False&lt;/tt&gt; to get around a temporary detrend bug. See &lt;a href=&quot;https://pfspipe.ipmu.jp/jira/browse/PIPE2D-715&quot; title=&quot;Remove updates to raw_visit table from ingestPfsImages.py&quot; class=&quot;issue-link&quot; data-issue-key=&quot;PIPE2D-715&quot;&gt;&lt;del&gt;PIPE2D-715&lt;/del&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Even though shell-2 is under provisioned (4-core, 4GB)I do &lt;b&gt;not&lt;/b&gt; see bad system contention (per &lt;tt&gt;dstat 1&lt;/tt&gt;), but detrend is still slow (12-30s).&lt;/p&gt;

&lt;p&gt;There are two oddities which need to be figured out before I will trust or suspect &lt;em&gt;anything&lt;/em&gt; else. One of the loggers (not the main actorcore/python logger, nor the LSST logger) multiplies itself, adding one line for each file processed. And when you quit the drpActor, there are a correspondingly increasing number of complaints from sqlite and from the multiplying logger. But according to the main thread, we only ever get four threads (not many many), and the thread ids printed by the sqlite complaint at the end are all the same:&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;2021-02-14 18:40:49.316Z actor            20 Actor.py:550 reactor dead, cleaning up...
actor INFO: reactor dead, cleaning up...
actor INFO: reactor dead, cleaning up...
actor INFO: reactor dead, cleaning up...
actor INFO: reactor dead, cleaning up...
actor INFO: reactor dead, cleaning up...
actor INFO: reactor dead, cleaning up...
actor INFO: reactor dead, cleaning up...
actor INFO: reactor dead, cleaning up...
actor INFO: reactor dead, cleaning up...
actor INFO: reactor dead, cleaning up...
actor INFO: reactor dead, cleaning up...
actor INFO: reactor dead, cleaning up...
actor INFO: reactor dead, cleaning up...
actor INFO: reactor dead, cleaning up...
Exception ignored in: &amp;lt;function SqlRegistry.__del__ at 0x7fd4fea88400&amp;gt;
Traceback (most recent call last):
  File &quot;/software/drp-5.2/stack/miniconda3-4.5.12-1172c30/Linux64/daf_persistence/18.1.0/python/lsst/daf/persistence/registries.py&quot;, line 323, in __del__
    self.conn.close()
sqlite3.ProgrammingError: SQLite objects created in a thread can only be used in that same thread. The object was created in thread id 140551400564480 and this is thread id 140553341876032.
Exception ignored in: &amp;lt;function SqlRegistry.__del__ at 0x7fd4fea88400&amp;gt;
Traceback (most recent call last):
  File &quot;/software/drp-5.2/stack/miniconda3-4.5.12-1172c30/Linux64/daf_persistence/18.1.0/python/lsst/daf/persistence/registries.py&quot;, line 323, in __del__
    self.conn.close()
sqlite3.ProgrammingError: SQLite objects created in a thread can only be used in that same thread. The object was created in thread id 140551400564480 and this is thread id 140553341876032.
Exception ignored in: &amp;lt;function SqlRegistry.__del__ at 0x7fd4fea88400&amp;gt;
Traceback (most recent call last):
  File &quot;/software/drp-5.2/stack/miniconda3-4.5.12-1172c30/Linux64/daf_persistence/18.1.0/python/lsst/daf/persistence/registries.py&quot;, line 323, in __del__
    self.conn.close()
sqlite3.ProgrammingError: SQLite objects created in a thread can only be used in that same thread. The object was created in thread id 140551400564480 and this is thread id 140553341876032.
Exception ignored in: &amp;lt;function SqlRegistry.__del__ at 0x7fd4fea88400&amp;gt;
Traceback (most recent call last):
  File &quot;/software/drp-5.2/stack/miniconda3-4.5.12-1172c30/Linux64/daf_persistence/18.1.0/python/lsst/daf/persistence/registries.py&quot;, line 323, in __del__
    self.conn.close()
sqlite3.ProgrammingError: SQLite objects created in a thread can only be used in that same thread. The object was created in thread id 140551400564480 and this is thread id 140553341876032.
Exception ignored in: &amp;lt;function SqlRegistry.__del__ at 0x7fd4fea88400&amp;gt;
Traceback (most recent call last):
  File &quot;/software/drp-5.2/stack/miniconda3-4.5.12-1172c30/Linux64/daf_persistence/18.1.0/python/lsst/daf/persistence/registries.py&quot;, line 323, in __del__
    self.conn.close()
sqlite3.ProgrammingError: SQLite objects created in a thread can only be used in that same thread. The object was created in thread id 140551400564480 and this is thread id 140553341876032.
Exception ignored in: &amp;lt;function SqlRegistry.__del__ at 0x7fd4fea88400&amp;gt;
Traceback (most recent call last):
  File &quot;/software/drp-5.2/stack/miniconda3-4.5.12-1172c30/Linux64/daf_persistence/18.1.0/python/lsst/daf/persistence/registries.py&quot;, line 323, in __del__
    self.conn.close()
sqlite3.ProgrammingError: SQLite objects created in a thread can only be used in that same thread. The object was created in thread id 140551400564480 and this is thread id 140553341876032.
Exception ignored in: &amp;lt;function SqlRegistry.__del__ at 0x7fd4fea88400&amp;gt;
Traceback (most recent call last):
  File &quot;/software/drp-5.2/stack/miniconda3-4.5.12-1172c30/Linux64/daf_persistence/18.1.0/python/lsst/daf/persistence/registries.py&quot;, line 323, in __del__
    self.conn.close()
sqlite3.ProgrammingError: SQLite objects created in a thread can only be used in that same thread. The object was created in thread id 140551400564480 and this is thread id 140553341876032.
Exception ignored in: &amp;lt;function SqlRegistry.__del__ at 0x7fd4fea88400&amp;gt;
Traceback (most recent call last):
  File &quot;/software/drp-5.2/stack/miniconda3-4.5.12-1172c30/Linux64/daf_persistence/18.1.0/python/lsst/daf/persistence/registries.py&quot;, line 323, in __del__
    self.conn.close()
sqlite3.ProgrammingError: SQLite objects created in a thread can only be used in that same thread. The object was created in thread id 140551400564480 and this is thread id 140553341876032.
Exception ignored in: &amp;lt;function SqlRegistry.__del__ at 0x7fd4fea88400&amp;gt;
Traceback (most recent call last):
  File &quot;/software/drp-5.2/stack/miniconda3-4.5.12-1172c30/Linux64/daf_persistence/18.1.0/python/lsst/daf/persistence/registries.py&quot;, line 323, in __del__
    self.conn.close()
sqlite3.ProgrammingError: SQLite objects created in a thread can only be used in that same thread. The object was created in thread id 140551400564480 and this is thread id 140553341876032.
Exception ignored in: &amp;lt;function SqlRegistry.__del__ at 0x7fd4fea88400&amp;gt;
Traceback (most recent call last):
  File &quot;/software/drp-5.2/stack/miniconda3-4.5.12-1172c30/Linux64/daf_persistence/18.1.0/python/lsst/daf/persistence/registries.py&quot;, line 323, in __del__
    self.conn.close()
sqlite3.ProgrammingError: SQLite objects created in a thread can only be used in that same thread. The object was created in thread id 140551400564480 and this is thread id 140553341876032.

&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                            <comment id="18504" author="cloomis" created="Mon, 15 Feb 2021 16:49:00 +0000"  >&lt;p&gt;A cute thing to notice in that last log: the &quot;actor&quot; logger is an actorcore thing, along with the &quot;cmds&quot;  logger. Both always use the formatting you see in that top line: the date, logger name, etc. But after the detrend task is called the first time, every output line on the actor logger then also generates the multiplying lines as formatted by the LSST logging system: the logger name, the level, the message.&lt;/p&gt;

&lt;p&gt;Also, detrend was being called on each camera, but without specifying the arm: the second call processed both arms. Fixed.&lt;/p&gt;

&lt;p&gt;FWIW, with the ingest raw_visit problem fixed, ingest+detrend take ~20-25s, which is fast enough to avoid piling up when taking, say, a sequence of biases. So I propose:&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;I&apos;ll close and merge this ticket, which includes some hack-y crap to simplify and track the problems.&lt;/li&gt;
	&lt;li&gt;Arnaud starts from that and works on the detrend ticket, which &lt;em&gt;might&lt;/em&gt; fix this stealing and multiplying problem.&lt;/li&gt;
	&lt;li&gt;If that does not work by the day SuNSS goes back on the sky, move detrend out into an external process, like ingest now is. Sure, we eat some overhead, but at least we can stay ahead of the incoming data and not eat ourselves.&lt;/li&gt;
	&lt;li&gt;Separately, have the listener gather all files for a given visit and process them all at once. Yes, that requires knowing which cameras are live, but that is doable.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Frankly, grouping all exposures fo a visit &lt;b&gt;and&lt;/b&gt; calling detrend.py externally is probably as good as we can do in any case: the detrend.py overhead will be taken up by the 8 exposures.&lt;/p&gt;

&lt;p&gt;And finally, I will request that shell2-ics be beefed up some more. This configuration is silly.&lt;/p&gt;</comment>
                            <comment id="18505" author="arnaud.lefur" created="Mon, 15 Feb 2021 17:28:42 +0000"  >&lt;p&gt;&lt;em&gt;Also, detrend was being called on each camera, but without specifying the arm: the second call processed both arms. Fixed.&lt;/em&gt;&lt;br/&gt;
that&apos;s right, but I did it on purpose. The idea is that since I&apos;m calling detrend without arm, the first call was processing all matching ingested files.&lt;br/&gt;
But in fact, I was checking the file existence before actually calling detrend, so when the second call kicks in, the file is already there, hence it just generates the filepath keyword for gingaActor. &lt;/p&gt;

&lt;p&gt;Agreed, will try to fix &lt;a href=&quot;https://pfspipe.ipmu.jp/jira/browse/INSTRM-1178&quot; title=&quot;replace drpActor parseAndRun&quot; class=&quot;issue-link&quot; data-issue-key=&quot;INSTRM-1178&quot;&gt;&lt;del&gt;INSTRM-1178&lt;/del&gt;&lt;/a&gt; asap and external call will definitely my safety net.&lt;/p&gt;</comment>
                            <comment id="18506" author="cloomis" created="Mon, 15 Feb 2021 17:30:22 +0000"  >&lt;p&gt;Merged at 76ee97a. Intended to be a sloppy mess.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10003">
                    <name>Relates</name>
                                            <outwardlinks description="relates to">
                                        <issuelink>
            <issuekey id="15277">PIPE2D-715</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10500" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                            <customfield id="customfield_10010" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0|zzs42g:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                    <customfield id="customfield_10002" key="com.atlassian.jira.plugin.system.customfieldtypes:float">
                        <customfieldname>Story Points</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                        </customfields>
    </item>
</channel>
</rss>