<div dir="ltr"><div dir="ltr">On Sun, Feb 6, 2022 at 1:07 PM Fabian Vogt <<a href="mailto:fabian@ritter-vogt.de">fabian@ritter-vogt.de</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,<br>
<br>
Am Samstag, 5. Februar 2022, 22:16:28 CET schrieb Ben Cooksley:<br>
> Hi all,<br>
> <br>
> Over the past week or so Sysadmin has been dealing with an extremely high<br>
> volume of traffic directed towards both <a href="http://download.kde.org" rel="noreferrer" target="_blank">download.kde.org</a> and<br>
> <a href="http://distribute.kde.org" rel="noreferrer" target="_blank">distribute.kde.org</a>.<br>
> <br>
> This traffic volume is curious in so far that it is directed at two paths<br>
> specifically:<br>
> - <a href="http://distribute.kde.org/khotnewstuff/fonts-providers.xml" rel="noreferrer" target="_blank">distribute.kde.org/khotnewstuff/fonts-providers.xml</a><br>
> - <a href="http://download.kde.org/ocs/providers.xml" rel="noreferrer" target="_blank">download.kde.org/ocs/providers.xml</a><br>
> <br>
> The first path is an "internal only" host which we were redirecting a<br>
> legacy path to prior to the resource being relocated to <a href="http://cdn.kde.org" rel="noreferrer" target="_blank">cdn.kde.org</a>. The<br>
> second path has been legacy for numerous years now (more than 5) and is<br>
> replaced by <a href="http://autoconfig.kde.org" rel="noreferrer" target="_blank">autoconfig.kde.org</a>.<br>
> It is of extreme concern that these paths are still in use - especially the<br>
> ocs/providers.xml one.<br>
> <br>
>...<br>
> <br>
> This indicates that the bug lies solely within Plasma's Discover component<br>
> - more precisely it's updater.<br>
> <br>
> Examining the origin of these requests has indicated that some clients are<br>
> making requests to these paths well in excess of several times a minute<br>
> with a number of IP addresses appearing more 60 times in a 1 minute sized<br>
> sample window.<br>
<br>
FWICT, this is caused by plasma-discover-update, which is triggered by the<br>
DiscoverNotifier service if automatic updates are enabled in kcm_updates,<br>
updates are available and the system idle for >=15min.<br>
<br>
// If the system is untouched for 1 hour, trigger the unattened update<br>
using namespace std::chrono_literals;<br>
KIdleTime::instance()->addIdleTimeout(int(std::chrono::milliseconds(15min).count()));<br>
<br>
(I wonder whether there's a bug about calling addIdleTimeout more than once.<br>
It will then invoke triggerUpdate multiple times after 15min of idle.)<br></blockquote><div><br></div><div>That may explain why we are seeing so many requests from some IPs and very few from others.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
The Discover KNS backend creates instances for all available knsrc files,<br>
which on construction call KNSReviews::setProviderUrl with the URL defined in<br>
those files, triggering the requests.<br></blockquote><div><br></div><div>That does not sound scalable, and would certainly explain why not too long ago we found that the traffic received by <a href="http://autoconfig.kde.org">autoconfig.kde.org</a> had grown to such an extent we had to shift it to being handled by a CDN.</div><div>At the time I chalked the problem up to increasing popularity of our software that included KNS functionality.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
The first URL is used by kfontinst.knsrc from plasma-workspace:<br>
ProvidersUrl=<a href="https://distribute.kde.org/khotnewstuff/fonts-providers.xml" rel="noreferrer" target="_blank">https://distribute.kde.org/khotnewstuff/fonts-providers.xml</a><br>
<br>
The second URL is used by multiple knsrc files in my VM:<br>
aurorae.knsrc:ProvidersUrl=<a href="https://download.kde.org/ocs/providers.xml" rel="noreferrer" target="_blank">https://download.kde.org/ocs/providers.xml</a><br>
comic.knsrc:ProvidersUrl=<a href="https://download.kde.org/ocs/providers.xml" rel="noreferrer" target="_blank">https://download.kde.org/ocs/providers.xml</a><br>
kwineffect.knsrc:ProvidersUrl=<a href="https://download.kde.org/ocs/providers.xml" rel="noreferrer" target="_blank">https://download.kde.org/ocs/providers.xml</a><br>
kwinscripts.knsrc:ProvidersUrl=<a href="https://download.kde.org/ocs/providers.xml" rel="noreferrer" target="_blank">https://download.kde.org/ocs/providers.xml</a><br>
kwinswitcher.knsrc:ProvidersUrl=<a href="https://download.kde.org/ocs/providers.xml" rel="noreferrer" target="_blank">https://download.kde.org/ocs/providers.xml</a><br>
wallpaperplugin.knsrc:ProvidersUrl=<a href="https://download.kde.org/ocs/providers.xml" rel="noreferrer" target="_blank">https://download.kde.org/ocs/providers.xml</a></blockquote><div><br></div><div>This makes me incredibly sad. We had a push to eliminate all usage of the legacy <a href="http://download.kde.org">download.kde.org</a> endpoint many years ago...</div><div>I have now resolved the majority of these - if distributions could please pick up those patches that would be appreciated.</div><div><br></div><div>Please note that I have now terminated the support on the server that was making these legacy endpoints work, so those patches are necessary to restore functionality.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
<br>
> Given that Sysadmin has raised issues with this component and it's<br>
> behaviour in the past, it appears that issues regarding the behaviour of<br>
> the OCS componentry within Discover remain unresolved.<br>
> <br>
> Due to the level of distress this is causing our systems, I am therefore<br>
> left with no other option other than to direct the Plasma Discover<br>
> developers to create and release without delay patches for all versions in<br>
> support, as well as for all those currently present in any actively<br>
> maintained distributions, that disable all OCS functionality in the<br>
> Discover updater. Distributions are requested to treat these patches as<br>
> security patches and to distribute them to users without delay.<br>
<br>
Emergency workarounds for distributions might be to either not ship the KNS<br>
backend by not building kns-backend.so or deleting it afterwards, or disabling<br>
the discover notifier (/etc/xdg/autostart/org.kde.discover.notifier.desktop)<br>
completely.<br></blockquote><div><br></div><div>I have now committed patches to Discover going back to Plasma/5.18 which disable the build of the KNS backend.</div><div>If distributions could please pick them up and distribute them as I previously indicated that would be much appreciated.</div><div><br></div><div><a href="https://invent.kde.org/plasma/discover/-/commit/f66df3531670592960167f5060feeed6d6c792be">https://invent.kde.org/plasma/discover/-/commit/f66df3531670592960167f5060feeed6d6c792be</a><br></div><div><br></div><div>Please note that I intend to investigate whether it is possible to serve corrupted files from the server side that cause Discover to crash to help alleviate the load being created by those clients.</div><div>Current load being generated by this is:</div><div><br></div><div><dt>789 requests/sec - 6.4 MB/second - 8.3 kB/request - 1.70113 ms/request</dt><br><dt>217 requests currently being processed, 183 idle workers</dt><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Cheers,<br>
Fabian<br>
<br>
<br></blockquote><div><br></div><div>Thanks,</div><div>Ben </div></div></div>