When using ProductSync with multiple ProductDrafts that reference product types, the library may issue multiple duplicate requests to fetch all product types.
まだ誰も着手していません。
評価
調査の方向性
ProductTypeServiceImpl.fetchCachedProductAttributeMetaDataMap(productTypeId) から開始し、fetchAndCacheProductMetaData と QueryUtils.queryAll を追跡します。ProductSync と商品タイプを参照する複数の ProductDrafts で再現します。後続の呼び出しで非同期のキャッシュウォームアップが共有され、重複した全件クエリが発行されなければ完了です。
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- Java
- スター
- 40
- フォーク
- 41
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
commercetools/commercetools-sync-java のほかの issue
-
Dependency Dashboardオープン
難易度 4/5 3〜5日 初心者へのやさしさ 20/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 32/100
commercetools/commercetools-sync-java#1201 · コメント 4 件 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 20/100
-
Hacktoberfest
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
commercetools/commercetools-sync-java の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
OpenAPITools/openapi-generator#25014 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
openhab/openhab-core#5847 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
apache/parquet-java#3820 ·
メンテナーはふだん 1 日以内に返信