Tatoeba / tatoeba2

Tatoeba is a platform whose purpose is to create a collaborative and open dataset of sentences and their translations.
https://tatoeba.org
GNU Affero General Public License v3.0
690 stars 130 forks source link

Internal error when using advanced search with no words #2041

Open Poulpisator opened 4 years ago

Poulpisator commented 4 years ago

Steps to reproduce Do this search: Sentences in English having Japanese translations limited to having indirect Japanese translations. https://tatoeba.org/fra/sentences/search?query=&from=eng&to=jpn&user=&orphans=no&unapproved=no&has_audio=&tags=&list=&native=&trans_filter=limit&trans_to=jpn&trans_link=indirect&trans_user=&trans_orphan=&trans_unapproved=&trans_has_audio=&sort=relevance&sort_reverse=

Add a word and the search works well.

trang commented 4 years ago

Is this still an issue? I can't reproduce.

alanfgh commented 4 years ago

I can't reproduce it either.

Poulpisator commented 4 years ago

Oh? But I can ^^ Simply clicking the link above gives me the "Internal Error occured" message.

[EDIT] It occurs only with my Firefox though... Let me investigate a little bit more and come back to you.

AndiPersti commented 4 years ago

I can reproduce the problem if I set the number of sentences per page to 100 but it works if I limit the number of sentences per page to 50.

So I think it's the same problem as described in #1737 and #2024 .

My theory for all these memory exhaustion issues: Whenever we want to display a page which includes many sentences with many translations (direct and indirect) then the underlying data structures in the memory will grow to big.

Some observations to backup that theory: -) Changing the sort parameter in the URL for this issue from relevance to e.g. created will show the page even with the number of sentences per page set to 100.

-) Reversing the relevance sort (adding reverse=yes to the URL) works.

-) Displaying the second page of the result (adding page=2 to the URL) works.

I've noticed that the issue is also present on dev so this should help for debugging. I would find it interesting to get the first 100 sentence ids for the result of this query.

ckjpn commented 5 months ago

I occasionally get this error message with searches. It's not limited to searches with no words.

The solution for me is to lower my sentences per page to 50 temporarily when this happens.