openfoodfacts-server
openfoodfacts-server copied to clipboard
Time-out for score computation for product with very few data
Describe the bug
From https://github.com/openfoodfacts/openfoodfacts-dart/issues/520
We currently use a product (with very few data) that when we try to compute the scores, fails with a time-out. Even the website itself crashes when we just add a nutrient value: https://world.openfoodfacts.net/product/7340011364184/chili-beans-null (off/off)
When I try, I get a time-out:
504 Gateway Time-out
nginx/1.21.6
To Reproduce
- go to https://world.openfoodfacts.net/product/7340011364184/chili-beans-null
- click on the "edit" button
- now that you are on the edit product page, just click on "save"
- there's a time out
Expected behavior
There shouldn't be a time out.
Screenshots
No response
Additional context
No response
Type of device
Other
Browser version
No response
Number of products impacted
No response
Time per product
No response
Trying to look at the log on the server, I tried, and failed (but I didn't get the right log) so I resend the query (refresh in my browser) and then it worked !
@monsieurtanuki do you have another example ?
The issue is not really "product with very few data" but "product with a lot of edits". As it's used by tests, it's been changed 1800 times. When we save a product, we go through the full history to look for changes. I'm guessing that's what is timing out.
One solution could be to compute the history only for last edit, instead of all edits.
This issue is stale because it has been open 90 days with no activity.