openfoodfacts-server icon indicating copy to clipboard operation
openfoodfacts-server copied to clipboard

Time-out for score computation for product with very few data

Open monsieurtanuki opened this issue 2 years ago • 3 comments

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

  1. go to https://world.openfoodfacts.net/product/7340011364184/chili-beans-null
  2. click on the "edit" button
  3. now that you are on the edit product page, just click on "save"
  4. 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

monsieurtanuki avatar Jul 20 '22 12:07 monsieurtanuki

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 !

alexgarel avatar Jul 20 '22 12:07 alexgarel

@monsieurtanuki do you have another example ?

alexgarel avatar Jul 20 '22 12:07 alexgarel

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.

stephanegigandet avatar Jul 25 '22 10:07 stephanegigandet

This issue is stale because it has been open 90 days with no activity.

github-actions[bot] avatar Oct 24 '22 00:10 github-actions[bot]