Retry-After parser accepts invalid delay-seconds values

Đang mở Phù hợp với người mới
#9,018 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 2 ngày

@Dhruvraj-Rana đang làm issue này rồi.

Từ ngày 8/11/2026.

  • #9019 của @Dhruvraj-Rana — đang mở

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
82/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
java
Lĩnh vực
backend-api-design

Hướng nghiên cứu

Bắt đầu với RetryUtil.retryAfterNanos và các bài kiểm thử hiện có trong io.opentelemetry.exporter.internal.RetryUtilTest. Kiểm tra cách trình phân tích cú pháp xử lý +30, -0 và ٣٠, rồi chạy lớp kiểm thử đó. Hoàn thành khi mỗi giá trị sai định dạng trả về OptionalLong.empty() và các giá trị giây chờ ASCII hợp lệ vẫn được phân tích cú pháp.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Java
Star
2.5k
Fork
1k
Merge trung bình
4 ngày 3 giờ
Pull request đã merge (30 ngày)
49

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của open-telemetry/opentelemetry-java

Tất cả issue của open-telemetry/opentelemetry-java

Issue tương tự

Thêm issue về Java

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.