Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blocked Agena import on off2, 99% cpu for 6 hours #9755

Closed
stephanegigandet opened this issue Feb 6, 2024 · 2 comments · Fixed by #9757 or #9760
Closed

Blocked Agena import on off2, 99% cpu for 6 hours #9755

stephanegigandet opened this issue Feb 6, 2024 · 2 comments · Fixed by #9757 or #9760
Assignees

Comments

@stephanegigandet
Copy link
Contributor

The nightly agena import seems blocked on off2:

output of top:
 278275 off       20   0 3103924   1.6g  12472 R  99.3   5.0 374:54.04 import_csv_file                   

off-pro:/mnt/off-pro/cache/tmp/agena3000-data# ps -ef | grep agena
off       277909  277698  0 03:28 ?        00:00:00 bash ./scripts/imports/agena3000/run_agena3000_import.sh
off       278275  277909  0 03:30 ?        06:13:52 /usr/bin/perl -w ./scripts/import_csv_file.pl --user_id agena3000 --org_id agena3000 --source_id agena3000 --source_name Agena3000 --source_url https://agena3000.com/ --manufacturer 1 --comment Import from Agena3000 --define lc=fr --images_download_dir /srv/off-pro/tmp/agena3000-data --csv_file /srv/off-pro/tmp/agena3000-data/agena3000-data.tsv

off@off-pro:/srv/off-pro/scripts$ wc -l /srv/off-pro/tmp/agena3000-data/agena3000-data.tsv
204 /srv/off-pro/tmp/agena3000-data/agena3000-data.tsv

@stephanegigandet stephanegigandet self-assigned this Feb 6, 2024
@stephanegigandet
Copy link
Contributor Author

Seems to be an infinite loop in parse_ingredients_text, with this input:

{language => "fr",text => "Sucre, LAIT* entier en poudre 25%, graisse v\x{e9}g\x{e9}tale (palme, palmiste), beurre de cacao1, p\x{e2}te de cacao1, LAIT* \x{e9}cr\x{e9}m\x{e9} en poudre 3%, huile de tournesol, \x{e9}mulsifiant: l\x{e9}cithines, ar\x{f4}mes de vanille. Traces \x{e9}ventuelles de fruits \x{e0} coque et de c\x{e9}r\x{e9}ales contenant du gluten. Cacao: 30% minimum dans le chocolat au lait. *Lait: origine UE et/ou non UE (Royaume-Uni)"}

@stephanegigandet
Copy link
Contributor Author

Deep recursion on anonymous subroutine at /opt/product-opener/lib/ProductOpener/Ingredients.pm line 2909.


						if ($between ne '') {
							# Ingredient has sub-ingredients

							# we may have separated 2 ingredients:
							# e.g. "salt and acid (acid citric)" -> salt + acid
							# the sub ingredients only apply to the last ingredient

							if ($i == $#ingredients) {
								$ingredient{ingredients} = [];
								$analyze_ingredients_self->(
									$analyze_ingredients_self, $ingredient{ingredients},
									$between_level, $between
								);
							}
						}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant