]> source.dussan.org Git - nextcloud-server.git/commitdiff
Prefetching blows up if there are a lot of files. 15146/head
authorRoeland Jago Douma <roeland@famdouma.nl>
Wed, 17 Apr 2019 19:37:16 +0000 (21:37 +0200)
committerRoeland Jago Douma <roeland@famdouma.nl>
Thu, 18 Apr 2019 19:23:59 +0000 (21:23 +0200)
I saw instances where people had a lot of files (each with custom
properties) and all this prefetching blew up and started to consume an
insane amount of RAM resulting in the process getting killed.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
apps/dav/lib/Connector/Sabre/CustomPropertiesBackend.php
apps/dav/tests/unit/Connector/Sabre/CustomPropertiesBackendTest.php

index c77a4d6be4811cf5deeaada7be42a89bc72cb522..f3f685a8b9e9bdeaa01831dc0633ece3b6b9a8da 100644 (file)
@@ -129,13 +129,6 @@ class CustomPropertiesBackend implements BackendInterface {
                        return;
                }
 
-               if ($node instanceof Directory
-                       && $propFind->getDepth() !== 0
-               ) {
-                       // note: pre-fetching only supported for depth <= 1
-                       $this->loadChildrenProperties($node, $requestedProps);
-               }
-
                $props = $this->getProperties($node, $requestedProps);
                foreach ($props as $propName => $propValue) {
                        $propFind->set($propName, $propValue);
index 91973eeff5db8b85abf6f252b3f2a6e1a983003c..3b7bd859b9ffa92ad429ce621833cee701809de4 100644 (file)
@@ -226,10 +226,6 @@ class CustomPropertiesBackendTest extends \Test\TestCase {
                        ->method('getPath')
                        ->will($this->returnValue('/dummypath/test.txt'));
 
-               $rootNode->expects($this->once())
-                       ->method('getChildren')
-                       ->will($this->returnValue(array($nodeSub)));
-
                $this->tree->expects($this->at(0))
                        ->method('getNodeForPath')
                        ->with('/dummypath')