Retrying an interrupted CreateTag never completes the Tag

Đang mở
#3,386 1 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 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
57/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ệ
go, grpc
Lĩnh vực
api, backend

Hướng nghiên cứu

Start with TagActorSnapshot in cmd/ateapi/internal/controlapi/workflow_tag.go:52-55 and trace the CreateTag retry path for a Tag left in SNAPSHOT_STORAGE_STATE_PENDING. Check the existing CreateTag, GetTag, and DeleteTag behavior, then add or run coverage for retrying after the deadline expires during snapshot copy. Done means the retry converges to a usable completed Tag, with the behavior for an already completed Tag matching the expected response.

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

Mô tả

area/api area/api-machinery kind/bug
What happened?

A CreateTag call whose deadline expires during the snapshot copy leaves the Tag in SNAPSHOT_STORAGE_STATE_PENDING. Retrying the same request returns AlreadyExists. The Tag stays PENDING until someone deletes it.

TagActorSnapshot documents this (cmd/ateapi/internal/controlapi/workflow_tag.go:52-55): the create is not idempotent, and the retry path is DeleteTag then CreateTag. DeleteTag followed by CreateTag does produce a COMPLETED Tag.

This causes three problems:

  • Clients that retry DeadlineExceeded or Unavailable with the same request never converge. They get AlreadyExists for a Tag they can't use.
  • A Tag left by a failed create looks the same as one still being created. Both are PENDING, so a client can't tell whether to wait or delete. Nothing cleans up the failed one.
Expected Behavior

Retrying the same CreateTag returns the finished Tag, or AlreadyExists for a COMPLETED Tag. No PENDING Tag is left behind.

Steps to Reproduce
  1. Deploy the counter demo: go run ./cmd/ate-setup deploy demo counter.
  2. Create an actor from the counter template. It starts SUSPENDED.
  3. Call CreateTag with source_actor set to that actor and a 20ms gRPC deadline. It returns DeadlineExceeded.
  4. GetTag shows the Tag at version 2 in SNAPSHOT_STORAGE_STATE_PENDING.
  5. Send the same CreateTag with no deadline. It returns AlreadyExists: Tag ate-demo-counter/bb-s1-short-tag already exists; delete it and create it again to retry.
  6. GetTag still shows PENDING. CreateActor with this Tag as source_tag returns FailedPrecondition: source Tag is still being created or failed creation.

kubectl ate can't send a short enough deadline to hit this. A Go client with context.WithTimeout can.

Ngôn ngữ chính
Go
Star
6.1k
Fork
676
Merge trung bình
2 ngày 41 phút
Pull request đã merge (30 ngày)
500

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 agent-substrate/substrate

Tất cả issue của agent-substrate/substrate

Issue tương tự

Thêm issue về Go

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.