When using ProductSync with multiple ProductDrafts that reference product types, the library may issue multiple duplicate requests to fetch all product types.
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 52/100
Direzione di ricerca
Inizia da ProductTypeServiceImpl.fetchCachedProductAttributeMetaDataMap(productTypeId) e traccia fetchAndCacheProductMetaData e QueryUtils.queryAll. Riproduci il problema con ProductSync e più ProductDrafts che fanno riferimento a tipi di prodotto; il lavoro è completato quando un’unica attività asincrona di riscaldamento della cache viene condivisa dalle chiamate successive invece di eseguire query complete duplicate.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Describe the bug
ProductTypeServiceImpl.fetchCachedProductAttributeMetaDataMap(productTypeId) checks:
if (productsAttributesMetaData.isEmpty()) { return fetchAndCacheProductMetaData(productTypeId); }
On the very first calls, the cache is still empty.
Each concurrent (or even sequential but fast) call triggers its own QueryUtils.queryAll(...).
Because the caching happens asynchronously, subsequent calls still see the cache as empty until the first queryAll finishes.
As a result, multiple identical full queries for product types are executed.
To Reproduce
Steps to reproduce the behavior:
Call sync with multiple ProductDrafts that reference product types
Expected behavior
The first call should trigger one asynchronous cache warm-up.
All subsequent calls (while the warm-up is in progress) should wait for the same future instead of starting new queries.
- Lingua principale
- Java
- Stelle
- 40
- Fork
- 41
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di commercetools/commercetools-sync-java
-
Dependency DashboardAperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 20/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 32/100
commercetools/commercetools-sync-java#1201 · 4 commenti ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 20/100
-
Hacktoberfest
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
Tutte le issue di commercetools/commercetools-sync-java
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
OpenAPITools/openapi-generator#25014 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
openhab/openhab-core#5847 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
apache/parquet-java#3820 ·
I maintainer di solito rispondono entro 1 giorno