<!-- 
RSS generated by JIRA (9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b) at Mon Feb 12 01:48:07 CET 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>Magnolia - Issue tracker</title>
    <link>https://jira.magnolia-cms.com</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-uk</language>    <build-info>
        <version>9.4.2</version>
        <build-number>940002</build-number>
        <build-date>19-01-2023</build-date>
    </build-info>


<item>
            <title>[MGNLETK-62] multisite detection: implement a rule based algorithm to make the outcome more predictable.</title>
                <link>https://jira.magnolia-cms.com/browse/MGNLETK-62</link>
                <project id="10290" key="MGNLETK">Extended Templating Kit (closed)</project>
                    <description>&lt;p&gt;While trying to fix some multi site related issues, I decided to rewrite the code to make it more readable and predictable.&lt;/p&gt;

&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;we have a set of rules which use matchers to match the sites&lt;/li&gt;
	&lt;li&gt;the processing can be analyzed by setting the logging to debug level
	&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
		&lt;li&gt;plain text descriptions, ...&lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
	&lt;li&gt;the rule set can be overwritten&lt;/li&gt;
&lt;/ul&gt;
</description>
                <environment></environment>
        <key id="21443">MGNLETK-62</key>
            <summary>multisite detection: implement a rule based algorithm to make the outcome more predictable.</summary>
                <type id="4" iconUrl="https://jira.magnolia-cms.com/secure/viewavatar?size=xsmall&amp;avatarId=10890&amp;avatarType=issuetype">Improvement</type>
                                            <priority id="6" iconUrl="https://jira.magnolia-cms.com/images/icons/priorities/neutral.gif">Neutral</priority>
                        <status id="6" iconUrl="https://jira.magnolia-cms.com/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="1">Fixed</resolution>
                                        <assignee username="pbaerfuss">Philipp B&#228;rfuss</assignee>
                                    <reporter username="pbaerfuss">Philipp B&#228;rfuss</reporter>
                        <labels>
                    </labels>
                <created>Tue, 23 Aug 2011 10:16:00 +0200</created>
                <updated>Mon, 5 Mar 2012 09:38:21 +0100</updated>
                            <resolved>Tue, 23 Aug 2011 13:32:13 +0200</resolved>
                                                    <fixVersion>1.4.3</fixVersion>
                                        <due></due>
                            <votes>0</votes>
                                    <watches>0</watches>
                                                                                                                <comments>
                            <comment id="39349" author="sbaur" created="Wed, 21 Sep 2011 18:20:22 +0200"  >&lt;p&gt;Hi Philipp&lt;/p&gt;

&lt;p&gt;We just tried to find the place, where those matchers /rule stes are located but didnt find them. Can you give us a hint, how we can make use of this improvement?&lt;/p&gt;</comment>
                            <comment id="44901" author="rico.jansen" created="Thu, 1 Mar 2012 15:51:30 +0100"  >&lt;p&gt;After we upgraded to ETK 1.4.4 we have performance issues, mainly in Admincentral website tree.&lt;br/&gt;
We traced it back to the ETKSiteManager and the findBestMatchingSites method. Our profiling shows it&lt;br/&gt;
spends a lot of time there when opening trees. Interestingly enough the JCR tree is still responsive.&lt;/p&gt;

&lt;p&gt;We do have a lot of site definitions (40+), so it has to iterate a lot of data.&lt;/p&gt;</comment>
                            <comment id="44906" author="had" created="Thu, 1 Mar 2012 16:14:04 +0100"  >&lt;p&gt;Hi Rico,&lt;/p&gt;

&lt;p&gt;thx for the info, is the method invocation the issue or is single invocation ok, but it gets called multiple times? Would it be possible to attach profiling data? Or at least average execution time for the method, number of executions during tree rendering and stacktrace showing where the invocations come from?&lt;/p&gt;

&lt;p&gt;Thx,&lt;br/&gt;
Jan&lt;/p&gt;</comment>
                            <comment id="44913" author="rico.jansen" created="Thu, 1 Mar 2012 16:46:20 +0100"  >&lt;p&gt;It looks like it gets called quite a lot, at least in the debugger it looks like it.&lt;br/&gt;
We had a hell of time finding the problem as it doesn&apos;t really manifest in our development environment.&lt;br/&gt;
Only with production data we see the issue clearly.&lt;br/&gt;
I have attached an example of a profile on our testserver. Opening the wetenschap tree with 10 items. &lt;br/&gt;
I also attached a stacktrace of a local development instance openening a similar tree. &lt;br/&gt;
I can try to provide more information but I haven&apos;t been able to get stacktraces out of our test environment showing&lt;br/&gt;
the problem.&lt;br/&gt;
Note that we have a lot of sites:&lt;br/&gt;
mgnl&amp;gt; info.magnolia.module.extendedtemplatingkit.ETKModule.getInstance().getSites().size();&lt;br/&gt;
===&amp;gt;&lt;br/&gt;
91&lt;/p&gt;</comment>
                            <comment id="44916" author="rico.jansen" created="Thu, 1 Mar 2012 17:32:01 +0100"  >&lt;p&gt;It seems it is caused some where else because getAssignedSite is called insanely often:&lt;br/&gt;
WARN   info.magnolia.module.extendedtemplatingkit.sites.ETKSiteManager 01.03.2012 17:24:54 &amp;#8211; getAssignedSite (52853 times) (returning default) took: 0 ms &lt;br/&gt;
This is clean startup up with me logging in, it is already called over 50.000 times.&lt;br/&gt;
Opening the wetenschap tree with 10 entries:&lt;br/&gt;
WARN   info.magnolia.module.extendedtemplatingkit.sites.ETKSiteManager 01.03.2012 17:26:43 &amp;#8211; getAssignedSite (99239 times) (returning default) took: 0 ms &lt;br/&gt;
So close to 50.000 calls for opening a tree with 10 entries. I have the feeling something is very wrong.&lt;/p&gt;

&lt;p&gt;Calls are mainly : &lt;br/&gt;
WARN   info.magnolia.module.extendedtemplatingkit.sites.ETKSiteManager 01.03.2012 17:26:19 &amp;#8211; Try to match domain &lt;span class=&quot;error&quot;&gt;&amp;#91;redactie-live.test.vpro.nl&amp;#93;&lt;/span&gt; and URI &lt;span class=&quot;error&quot;&gt;&amp;#91;/&amp;#93;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;A short analysis:&lt;br/&gt;
cat magnolia.log | grep &apos;Try to match&apos;  | cut &lt;del&gt;d&lt;/del&gt; -f2,3,4,5 | sort | uniq -c&lt;br/&gt;
      1	- Try to match domain &lt;span class=&quot;error&quot;&gt;&amp;#91;null&amp;#93;&lt;/span&gt; and URI &lt;span class=&quot;error&quot;&gt;&amp;#91;/&amp;#93;&lt;/span&gt;&lt;br/&gt;
  45421	- Try to match domain &lt;span class=&quot;error&quot;&gt;&amp;#91;redactie-live.test.vpro.nl&amp;#93;&lt;/span&gt; and URI &lt;span class=&quot;error&quot;&gt;&amp;#91;/&amp;#93;&lt;/span&gt;&lt;br/&gt;
      1	- Try to match domain &lt;span class=&quot;error&quot;&gt;&amp;#91;redactie-live.test.vpro.nl&amp;#93;&lt;/span&gt; and URI &lt;span class=&quot;error&quot;&gt;&amp;#91;/.resources/controls/navigation/mgnlNavigationBgHover.gif&amp;#93;&lt;/span&gt;&lt;/p&gt;

</comment>
                            <comment id="44952" author="rico.jansen" created="Fri, 2 Mar 2012 13:38:13 +0100"  >&lt;p&gt;I have traced the issue back to SimpleUrlPattern in the Magnolia core, this has been changed&lt;br/&gt;
so it calls getAssignedSite on match operations. This apparently happens a lot in the FilterChain.&lt;/p&gt;

&lt;p&gt;I have implemented a simple LRU cache on the call, it keys on domain+uri. This has given us a big&lt;br/&gt;
performance boost in Admincentral.  &lt;/p&gt;

&lt;p&gt;Installed on a public node, this also shows quite a lot of calls winding up in the cache, not as much&lt;br/&gt;
as a author node though.&lt;br/&gt;
Author:&lt;br/&gt;
Try to match domain &lt;span class=&quot;error&quot;&gt;&amp;#91;redactie-test.vpro.omroep.nl&amp;#93;&lt;/span&gt; and URI &lt;span class=&quot;error&quot;&gt;&amp;#91;/.imaging/stk/hollanddoc/interne-teaser-small/media/hollanddoc/2010/July/armoede/original/armoede.jpg&amp;#93;&lt;/span&gt; : Hit/Miss : 13008113/1200&lt;br/&gt;
Public:&lt;br/&gt;
Try to match domain &lt;span class=&quot;error&quot;&gt;&amp;#91;geschiedenis-test.vpro.omroep.nl&amp;#93;&lt;/span&gt; and URI &lt;span class=&quot;error&quot;&gt;&amp;#91;/quiz/stripquiz.html&amp;#93;&lt;/span&gt; : Hit/Miss : 395592/45&lt;/p&gt;

&lt;p&gt;Attached are the diffs to the code of 1.4.4&lt;/p&gt;</comment>
                            <comment id="44955" author="had" created="Fri, 2 Mar 2012 13:45:28 +0100"  >&lt;p&gt;Excellent. Thanks a lot Rico.&lt;/p&gt;</comment>
                            <comment id="44958" author="rico.jansen" created="Fri, 2 Mar 2012 14:12:33 +0100"  >&lt;p&gt;You&apos;re welcome, &lt;br/&gt;
It still bothers me a bit that it gets called that often, but finding out who calls it how often is quite the excercise. It comes from the filters in the FilterChain that much I have found out, SimpleUrlPattern gets used a lot there I do know that as well.&lt;/p&gt;</comment>
                            <comment id="44964" author="kraft" created="Fri, 2 Mar 2012 15:17:16 +0100"  >&lt;p&gt;shouldn&apos;t this issue be reopened given the new evidence? Or new issue be created?&lt;/p&gt;</comment>
                            <comment id="44970" author="rico.jansen" created="Fri, 2 Mar 2012 17:46:17 +0100"  >&lt;p&gt;Well technically this issue has been resolved. It is more that the performance suffers from the combination of this issue and issue: &lt;a href=&quot;http://jira.magnolia-cms.com/browse/MAGNOLIA-3915&quot; class=&quot;external-link&quot; rel=&quot;nofollow&quot;&gt;http://jira.magnolia-cms.com/browse/MAGNOLIA-3915&lt;/a&gt; &lt;br/&gt;
The changes in this one means that the call takes a bit longer, but the changes in SimpleUrlMatcher means it gets called lots more often then in the past.&lt;/p&gt;

&lt;p&gt;I have made issue : &lt;a href=&quot;http://jira.magnolia-cms.com/browse/MGNLETK-72&quot; class=&quot;external-link&quot; rel=&quot;nofollow&quot;&gt;http://jira.magnolia-cms.com/browse/MGNLETK-72&lt;/a&gt; which references those two.&lt;/p&gt;</comment>
                            <comment id="44978" author="rico.jansen" created="Mon, 5 Mar 2012 09:38:21 +0100"  >&lt;p&gt;It seems there is a small bug in the diff I posted, in the setSize call I refrain to wrap the LRUMap&lt;br/&gt;
in a synchronized collection. This is necessary as LRUMap is not threadsafe.&lt;/p&gt;

&lt;p&gt;BTW The code is working nicely in production here.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10040">
                    <name>causality</name>
                                                                <inwardlinks description="is causing">
                                        <issuelink>
            <issuekey id="23278">MGNLETK-72</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10022">
                    <name>supersession</name>
                                            <outwardlinks description="supersedes">
                                        <issuelink>
            <issuekey id="20800">MGNLETK-57</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="21063">MGNLETK-59</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is superseded by">
                                        <issuelink>
            <issuekey id="19984">MGNLETK-51</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                            <attachment id="15840" name="ETKModule.diff" size="1409" author="rico.jansen" created="Fri, 2 Mar 2012 13:38:13 +0100"/>
                            <attachment id="15841" name="ETKSiteManager.diff" size="4223" author="rico.jansen" created="Fri, 2 Mar 2012 13:38:13 +0100"/>
                            <attachment id="15835" name="local-stacktrace.png" size="451476" author="rico.jansen" created="Thu, 1 Mar 2012 16:46:20 +0100"/>
                            <attachment id="15833" name="profile-data.png" size="130544" author="rico.jansen" created="Thu, 1 Mar 2012 16:46:20 +0100"/>
                            <attachment id="15834" name="tree-openend.png" size="71267" author="rico.jansen" created="Thu, 1 Mar 2012 16:46:20 +0100"/>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                            <customfield id="customfield_14166" key="com.okapya.jira.checklist:checklist">
                        <customfieldname>Acceptance criteria</customfieldname>
                        <customfieldvalues>
                            
        <checklist>
        <![CDATA[
                            




                
                                    <div class="o-completion" style="display: flex; flex-shrink: 0;"><span  class="aui-lozenge aui-lozenge-complete" style="font-size: 12px; font-weight: normal; display: flex; flex-direction: row; align-items: center;" ><span style="padding-right: 4px; vertical-align: middle;"><svg width="15" height="15" viewBox="0 0 15 15" xmlns="http://www.w3.org/2000/svg" fill="white"><path clip-rule="evenodd" d="m10.41037,3.42544l-7.86501,0c-0.72395,0 -1.31084,0.58688 -1.31084,1.31084l0,7.86508c0,0.7239 0.58689,1.3108 1.31084,1.3108l7.86501,0c0.724,0 1.3109,-0.5869 1.3109,-1.3108l0,-7.86508c0,-0.72396 -0.5869,-1.31084 -1.3109,-1.31084zm-7.86501,-0.65542c-1.08593,0 -1.96626,0.88032 -1.96626,1.96626l0,7.86508c0,1.0859 0.88033,1.9662 1.96626,1.9662l7.86501,0c1.086,0 1.9663,-0.8803 1.9663,-1.9662l0,-7.86508c0,-1.08594 -0.8803,-1.96626 -1.9663,-1.96626l-7.86501,0z" fill-rule="evenodd"/><path d="m5.09049,10.18526l-1.82767,-1.82766l-0.78479,0.78479l2.61246,2.61246l5.38758,-5.38754l-0.78483,-0.78479l-4.60275,4.60274z"/></svg></span><span>Empty</span></span></div>
                        ]]>
    </checklist>


                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10111" key="com.atlassian.jira.toolkit:reporterdomain">
                        <customfieldname>Company</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>woowai.com</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_10031" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of First Response</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Wed, 21 Sep 2011 18:20:22 +0200</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_12730" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_14151" key="com.atlassian.jira.toolkit:message">
                        <customfieldname>Docu info</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10061" key="com.atlassian.jira.toolkit:lastusercommented">
                        <customfieldname>Last comm is not jira-dev</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>true</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10071" key="com.atlassian.jira.toolkit:lastupdaterorcommenter">
                        <customfieldname>Last participant</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>mmuehlebach</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_13136" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            11 years, 50 weeks, 6 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                            <customfield id="customfield_10020" key="com.atlassian.jira.toolkit:attachments">
                        <customfieldname>Number of attachments</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>5.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10150" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname>Number of comments</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>11.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_10011" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>kraft</customfieldvalue>
            <customfieldvalue>had</customfieldvalue>
            <customfieldvalue>pbaerfuss</customfieldvalue>
            <customfieldvalue>rico.jansen</customfieldvalue>
            <customfieldvalue>sbaur</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                <customfield id="customfield_10833" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0|i009iv:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10244" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1579</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_14145" key="com.intenso.jira.issue-templates:issue-templates-customfield">
                        <customfieldname>Template</customfieldname>
                        <customfieldvalues>
                            


                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                            <customfield id="customfield_15131" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Time in Discovery</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10032" key="com.atlassian.jira.ext.charting:timeinstatus">
                        <customfieldname>Time in Status</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        </customfields>
    </item>
</channel>
</rss>