Retry-After parser accepts invalid delay-seconds values

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

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

@Dhruvraj-Rana がすでに取り組んでいます。

2026年11月8日 から。

  • #9019 @Dhruvraj-Rana による — オープン

評価

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

調査の方向性

RetryUtil.retryAfterNanos と io.opentelemetry.exporter.internal.RetryUtilTest にある既存のテストから始めてください。パーサーが +30、-0、٣٠ をどのように処理するか確認し、そのテストクラスを実行してください。不正な値がそれぞれ OptionalLong.empty() を返し、有効な ASCII の遅延秒数が引き続き解析されれば完了です。

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

説明

Bug

Describe the bug

The internal RetryUtil.retryAfterNanos parser accepts +30 as a 30-second delay and -0 as zero. Long.parseLong also accepts non-ASCII decimal digits. These values do not match the HTTP Retry-After delay-seconds grammar (1*DIGIT, ASCII 0–9).

The JDK and OkHttp HTTP senders use this parser. An accepted malformed value overrides their ordinary retry backoff instead of being ignored.

Steps to reproduce

In the existing io.opentelemetry.exporter.internal.RetryUtilTest, pass +30, -0, or ٣٠ to RetryUtil.retryAfterNanos(value, Instant.EPOCH).

What did you expect to see?

OptionalLong.empty(), as for other malformed values, so the ordinary retry policy applies.

What did you see instead?

OptionalLong.of(30000000000L) for +30; OptionalLong.of(0L) for -0; non-ASCII decimal digits are also parsed as a delay.

What version and what artifacts are you using?

Artifacts: exporters/common (used by the JDK and OkHttp senders)
Version: source checkout at f02bddc
How referenced: direct source checkout

Environment

Compiler: Temurin 25.0.5
OS: macOS 15.5

Additional context

The HTTP grammar is defined in RFC 9110 section 10.2.3.

主要言語
Java
スター
2.5k
フォーク
1k
平均マージ
4日 3時間
マージ済み PR(30日)
49

環境構築

はじめの一歩

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

open-telemetry/opentelemetry-java のほかの issue

open-telemetry/opentelemetry-java の issue をすべて見る

似ている issue

Java の issue をもっと見る

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

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