Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

When using ProductSync with multiple ProductDrafts that reference product types, the library may issue multiple duplicate requests to fetch all product types.

オープン
#1,228 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
52/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
java
領域
backend

調査の方向性

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 はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

commercetools/commercetools-sync-java のほかの issue

commercetools/commercetools-sync-java の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。