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

[BUG] MissingRequiredPropertyException: Missing required property 'ResourceStats.average' when polling _tasks API

オープン 初心者向け
#2,008 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

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

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
72/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
静か
技術スタック
java
領域
api, backend

調査の方向性

spec/schemas/_common.yaml から始め、ResourceStats の要件を、ここに示されている OpenSearch 1.3 の _tasks レスポンスと比較してください。仕様を変更する前に互換性マトリックスを確認し、その後、resource_stats.total のみを含む処理中のレスポンスを処理できること、および既存のクライアントテストが成功することを検証してください。

索引モデルが issue の本文から書いたものです。

説明

untriaged
What is the bug?

The ResourceStats schema in spec/schemas/_common.yaml of the opensearch-api-specification marks average, max, min, thread_info, and total as all required. However, the _tasks API on OpenSearch 1.3 only returns total in the resource_stats block when a task is in-flight.

Per the compatibility matrix, opensearch-java 3.x supports OpenSearch 1.x-3.x, so the spec should reflect what 1.x actually returns.

This causes the opensearch-java 3.8.0 client to throw:

org.opensearch.client.util.MissingRequiredPropertyException: Missing required property 'ResourceStats.average'
    at org.opensearch.client.util.ApiTypeHelper.requireNonNull(ApiTypeHelper.java:90)
    at org.opensearch.client.opensearch._types.ResourceStats.<init>(ResourceStats.java:82)
    at org.opensearch.client.opensearch._types.ResourceStats$Builder.build(ResourceStats.java:302)
    at org.opensearch.client.json.ObjectBuilderDeserializer.deserialize(ObjectBuilderDeserializer.java:92)
How can one reproduce the bug?

1. Index test documents (100k+):

POST /test-index/_bulk
{"index":{"_id":"1"}}
{"date":"2020-01-01T00:00:00Z","status":"OPEN"}
{"index":{"_id":"2"}}
{"date":"2020-01-01T00:00:00Z","status":"OPEN"}
... (repeat to 100k+ documents)

2. Submit async delete-by-query:

POST /test-index/_delete_by_query?wait_for_completion=false&conflicts=proceed
{
  "query": {
    "range": {
      "date": {
        "lt": "now-6M/d"
      }
    }
  }
}

Response:

{
  "task": "nodeId:1234567"
}

3. Poll the task while it's still running:

GET /_tasks/nodeId:1234567

In-flight response (before task completes):

{
  "completed": false,
  "task": {
    "node": "nodeId",
    "id": 1234567,
    "type": "transport",
    "action": "indices:data/write/delete/byquery",
    "status": {
      "total": 100000,
      "updated": 0,
      "created": 0,
      "deleted": 11000,
      "batches": 12,
      "version_conflicts": 0,
      "noops": 0,
      "retries": {
        "bulk": 0,
        "search": 0
      },
      "throttled_millis": 0,
      "requests_per_second": -1.0,
      "throttled_until_millis": 0
    },
    "description": "delete-by-query [test-index]",
    "start_time_in_millis": 1781528541973,
    "running_time_in_nanos": 587603829,
    "cancellable": true,
    "cancelled": false,
    "headers": {},
    "resource_stats": {
      "total": {
        "cpu_time_in_nanos": 0,
        "memory_in_bytes": 0
      }
    }
  }
}

Note: resource_stats contains only total. The fields average, max, min, and thread_info are absent. The opensearch-java 3.8.0 client fails to deserialize this response because ResourceStats marks all five fields as required.

4. After task completes, resource_stats is no longer present in the response, which is why this only surfaces when polling in-flight tasks with large enough data volumes for the task to take seconds.

Environment
  • opensearch-java client version: 3.8.0
  • OpenSearch server: 1.3
  • Java version: 17
主要言語
Java
スター
165
フォーク
257
平均マージ
1日 1時間
マージ済み PR(30日)
44

環境構築

はじめの一歩

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

opensearch-project/opensearch-java のほかの issue

opensearch-project/opensearch-java の issue をすべて見る

似ている issue

Java の issue をもっと見る

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

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