Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Webserver blockiert, wenn der Suchindex aktualisiert wird #8449

Closed
splinter03 opened this issue Aug 25, 2016 · 14 comments
Closed

Webserver blockiert, wenn der Suchindex aktualisiert wird #8449

splinter03 opened this issue Aug 25, 2016 · 14 comments
Assignees
Labels
Milestone

Comments

@splinter03
Copy link

Aktualisiert man den Suchindex, werden gleichzeitig mehrere hundert Anfragen an den Webserver gesendet. Das führt bei einigen Providern (wie z.B. 1und1) dazu, dass die Requests blockiert werden (sicher ein DDOS-Schutz). Arbeitet man die Requests sequentiell ab, läuft die Indizierung problemlos durch. Dafür ist die Modifikation des Templates "be_rebuild_index.html5" notwendig:

window.addEvent('domready', function() {
    var urls = $$('.page_url');
    performRequest(urls);
});

function performRequest(urls) {
    var span = urls[0];
    var url = span.getAttribute('data-url');

    if (url) {
        var request = new Request({
            'url': url,
            onSuccess: function() {
                span.addClass('tl_green');
            },
            onFailure: function(xhr) {
                span.addClass('tl_red');
                span.set('text', span.get('text') + ' - ' + xhr.status );
            },
            onComplete: function() {
                checkStatus(urls);
            }
        }).get();
    }
    else {
        checkStatus(urls);
    }
}

function checkStatus(urls) {
    urls.shift();
    if (urls.length > 0) {
        performRequest(urls);
    }
    else {
        $('index_loading').setStyle('display', 'none');
        $('index_complete').setStyle('display', 'block');
    }
}
@leofeyer
Copy link
Member

-1 von mir. Die sequenzielle Abarbeitung dauert einfach viel länger und wir sollten das nicht allen Benutzern zumuten, besonders weil das Problem bei einem Großteil gar nicht auftritt.

@splinter03
Copy link
Author

Langsam ist es, aber dafür auch zuverlässig.

weil das Problem bei einem Großteil gar nicht auftritt.

...das wage ich zu bezweifeln, da alle, die auf das LTS setzen, das gar nicht mitbekommen, da das original "be_rebuild_index.html5"-Template ja immer Erfolg meldet. Ist aber auch nur mein persönliches Baugefühl dazu, da ich auch nur zufällig darauf gestoßen bin, dass unser Suchindex unvollständig ist.

@leofeyer
Copy link
Member

Das kannst Du leicht herausfinden, indem Du die Änderungen am Template aus Contao 4.2 übernimmst.

@contao/developers Sollten wir vielleicht die MooTools Request Queue an dieser Stelle verwenden?

@bytehead
Copy link
Member

@leofeyer Hab ich schon versucht, die Request Queue von Mootools ist aber buggy.

@Toflar
Copy link
Member

Toflar commented Aug 25, 2016

Richtig wäre es mit Promises zu lösen.

@leofeyer
Copy link
Member

Dafür bräuchten wir aber MooTools 1.6. 😄

@leofeyer
Copy link
Member

Nicht dass wir das nicht hätten, nur: #8411 (comment)

@Toflar
Copy link
Member

Toflar commented Aug 25, 2016

Nö, nur ein Promises Polyfill für die Browser ohne ES6 Support. Aber auf die 1.6 können wir doch eh updaten? Ist ja ein rückwärtskompatibles Bugfix-Release (klar mit neuen Features, aber auch mit Bugfixes).

@leofeyer
Copy link
Member

leofeyer commented Oct 7, 2016

Behoben in 891ad94.

@tsarma
Copy link

tsarma commented Oct 26, 2016

While rebuilding index of a site containing over 16000 pages. It stopped sending ajax request to server after first encounter of 404 page. It happened after indexing 6000 pages and after about 40 mins.

404

@leofeyer
Copy link
Member

Did you adjust the be_rebuild_index.html5 template?

@leofeyer
Copy link
Member

The stopOnFailure option is definitely disabled.

@tsarma
Copy link

tsarma commented Oct 26, 2016

No I did not edit the be_rebuild_index.html5

@leofeyer
Copy link
Member

See #8541.

jsonn pushed a commit to jsonn/pkgsrc that referenced this issue Oct 27, 2016
### 4.2.5 (2016-10-27)

 * Unlock members after password change (see contao/core#8545).
 * Register an alias for the language fallback page model (see
   contao/core#8544).
 * Correctly calculate the maximum length of tl_files.name (see
   contao/core#8536).
 * Correctly add the headline if a content element is versionized (see
   contao/core#8502).
 * Optimize the DCA sorting filter for date fields (see contao/core#8485).
 * Do not show version entries of deleted files (see contao/core#8480).
 * Redirect the empty URL depending on language and alias name (see
   contao/core#8498).
 * Apply `specialchars()` to widget attributes (see contao/core#8505).
 * Queue the requests when rebuilding the search index (see contao/core#8449).
 * Correctly determine the form field names in the file manager (see #600).
 * Correctly show the maximum file size in the form upload widget (see #595).
 * Correctly encode e-mail addresses in the text element (see #594).
 * Do not parse front end templates twice (see #599).
 * Correctly set host and scheme in the URL generator (see #592).
 * Correctly reload the page and file trees in "edit multiple" mode.
 * Correctly normalize the paths in the symlink command.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants