Circular SearchRanking associations make the Shopware 6.7.15 admin search run out of memory
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 70/100
Research direction
The cycle comes from the ASSOCIATION_SEARCH_RANKING flags on blogAuthor and blogCategories in BlogEntryDefinition and on the inverse blogEntries associations in BlogAuthorDefinition and BlogCategoryDefinition. Start by finding those flags and removing SearchRanking from the two blogEntries associations as the issue suggests. Done means a DAL term search on werkl_blog_entry no longer recurses, and searching blog entries by author or category name still returns results.
Written by the indexing model from the issue text.
Description
Circular SearchRanking associations make the Shopware 6.7.15 admin search run out of memory
OpenBlogware version: 5.3.3 · Shopware version: 6.7.15.1
Description
The blog entity definitions flag associations that point back to each other with SearchRanking:
BlogEntryDefinition:blogAuthorandblogCategories(ASSOCIATION_SEARCH_RANKING)BlogAuthorDefinition:blogEntries(ASSOCIATION_SEARCH_RANKING)BlogCategoryDefinition:blogEntries(ASSOCIATION_SEARCH_RANKING)
Shopware's EntityScoreQueryBuilder follows SearchRanking associations recursively without a cycle guard, so a DAL term search on werkl_blog_entry, werkl_blog_author or werkl_blog_category recurses forever.
Since Shopware 6.7.15 the administration global search falls back to the DAL term search for entities without an admin Elasticsearch indexer (shopware/shopware#19399). With admin Elasticsearch enabled, typing in the global search now exhausts PHP memory (EntityScoreQueryBuilder.php line 58) as soon as the blog entities are part of the search preferences, which they are by default.
Steps to reproduce
- Shopware 6.7.15.1 with
SHOPWARE_ADMIN_ES_ENABLED=1, OpenBlogware 5.3.3 installed. - Type any term in the administration global search, or
POST /api/_admin/es-searchwith{"term": "test", "entities": ["werkl_blog_entry"]}.
Suggested fix
Drop SearchRanking from the inverse blogEntries associations in BlogAuthorDefinition and BlogCategoryDefinition. Searching blog entries by author or category name still works through blogAuthor / blogCategories. The cycle is reported to Shopware core as well (shopware/shopware#21580).
- Dominant language
- PHP
- Stars
- 43
- Forks
- 21
- Avg merge
- 12d 20h
- Merged PRs (30d)
- 1
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Werkstattl/OpenBlogware
-
Difficulty 3/5 1-2 days Newbie friendliness 28/100
Werkstattl/OpenBlogware#91 · 1 comment ·
-
Auflistung im Element eingrenzenPossibly taken @7underlines claimed this today. Openbug
Werkstattl/OpenBlogware#70 · 2 comments · 1 assignee ·
All issues in Werkstattl/OpenBlogware
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Automattic/blocks-engine#2803 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
hestiacp/hestiacp#5798 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
woocommerce/woocommerce-google-analytics-integration#699 ·
Maintainers usually reply within 1 day
-
Sidebar highlights two items when plugin routes share a prefix (/plugin/foo and /plugin/foo-bar)Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
getgrav/grav-plugin-admin2#195 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 60/100
Maintainers usually reply within 1 day