Skip to content

[Bug]: TestRequestParking/BudgetExhaustion flakes on a lease conflict #4008

Open

Description

@chuangw6

What happened?

TestRequestParking/BudgetExhaustion fails intermittently in CI. Status and timing are as expected (503 after the 5 s park budget); only the body is wrong:

parking_test.go:176: body = "actor ate-e2e-parking/parked-a unavailable: another operation is in progress for this actor", want the router's capacity verdict

Three failures in two days, on unrelated PRs, in both the gVisor and micro-VM lanes:

Cause

Taking an actor's lease is a single attempt: if anything holds it, the caller gets Aborted: another operation is in progress at once, however briefly the holder keeps it. The router retries ResumeActor for the park budget and answers with the last retryable error, so one conflict on the final attempt replaces the earlier ResourceExhausted: no worker has room for the actor answers.

The likely holder is the snapshot report for actor A, which the previous subtest suspended asynchronously moments earlier (ApplyReportedSnapshotState takes the actor's lease for a few milliseconds). I could not confirm it: the diagnostics step keeps the last 300 log lines per container and runs minutes after the failure, so the API server's lease lines for that window are gone in all three runs.

Expected Behavior

A short-lived internal lease holder does not surface as an error to a user-facing call. The parked request is answered with the capacity error.

Proposed fix

In acquireLease, have user-facing operations retry a conflicting lease for a short bounded time (a few hundred milliseconds) before returning Aborted. Background reports keep failing fast.

This is the same problem as #3945, where DeleteActor often returns Aborted: another operation is in progress at high density and the ask is for the server to wait or serialize instead. One change in acquireLease would address both.

Related: #675 (an earlier TestRequestParking flake with a different cause).

Activity

  1. added
    kind/bug
    area/tests
    on Nov 19, 2026
  2. changed the title [-][Bug]: TestRequestParking/BudgetExhaustion flakes: 503 body is "another operation is in progress" instead of "no worker has room"[/-] [+][Bug]: TestRequestParking/BudgetExhaustion flakes on a lease conflict[/+] on Nov 19, 2026
  3. Nagato-Yuzuru commented on Nov 22, 2026

    @Nagato-Yuzuru

    I'd like to work this.

    Waiting in acquireLease should fix it. I think there is a better option that ApplyReportedSnapshotState stops taking the actor lease. AFAICT, the lease adds no protection to the report. The report already refuses an Actor in a transitional state, and its only write, UpdateActor, checks the version. A conflict then needs no wait, and each report saves two lease writes, in line with #3977.

    The cost is that Resume must re-read and retry when its first write hits a version conflict. The workflow is already re-entrant, so this moves the client's retry into the server. A report can also land while Tag promotes the snapshot, so Tag re-reads on a conflict too.

    igooch you added the lease in #2622. Was it guarding anything beyond the version check?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/testskind/bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions