Skip to content

fix(daytona): avoid polling after snapshot conflict - #2589

Closed
easyrider11 wants to merge 3 commits into
harbor-framework:mainfrom
easyrider11:agent/fix-daytona-snapshot-conflict-wait
Closed

easyrider11 wants to merge 3 commits into
harbor-framework:mainfrom
easyrider11:agent/fix-daytona-snapshot-conflict-wait

Conversation

@easyrider11

@easyrider11 easyrider11 commented Aug 3, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • treat a snapshot-create conflict as confirmation that the deterministic snapshot name already exists
  • skip the follow-up GET visibility poll, which can otherwise wait for 10 minutes while swallowing repeated lookup failures
  • add a regression test for a conflict where the snapshot remains invisible to GET

Why not the one-line fix suggested in #2417

A 409 proves the name is taken, not that the snapshot behind it is usable. Returning
unconditionally would also return for PENDING snapshots (sandbox creation then races a
snapshot that is still building) and for ERROR snapshots (a broken snapshot reaches sandbox
creation instead of failing with a clear build error). The conflict branch therefore does one
classifying GET and skips the wait only on DaytonaNotFoundError (trust the 409 — the reported
case) or ACTIVE; PENDING and other lookup failures fall back to a bounded _wait_for_active,
and ERROR fails fast.

Validation

  • uv run pytest tests/unit/environments/test_daytona_snapshots.py -q (3 passed)
  • uv run pytest tests/unit/ (5375 passed, 15 skipped)
  • uv run ruff check --fix .
  • uv run ruff format .
  • uv run ty check

Addresses #2417.

@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Enjoy a better diff viewing experience by clicking one of these URLs:

@easyrider11
easyrider11 marked this pull request as ready for review August 3, 2026 21:20
@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

@penfever, this PR changes a file listed for your review:

  • "src/harbor/environments/daytona/snapshots.py"

devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

@stbenjam

Copy link
Copy Markdown
Contributor

Thanks for the contribution! Harbor has changed since this was opened and the branch now has conflicts, so we're closing older inactive PRs to catch up on the queue. This isn't a judgment on the value of the change. If it's still important to you, please rebase on main and open a new PR that links this one.

@stbenjam stbenjam closed this Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:environments area:tests triage:stale Inactive PR with conflicts; candidate for closure during backlog triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants