oxidecomputer / oxidecomputer/packer-plugin-oxide
Configurable timeouts and cancellation-aware polling
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 2
- Forks
- 1
- Avg merge
- 3h 9m
- Merged PRs (30d)
- 3
Description
Problem
All lifecycle waits are hard-coded to 30 seconds with no config knob: instance start (step_instance_create.go), instance stop (step_instance_stop.go), and every cleanup call (context.TODO() + 30s). 30s to stop an instance that just ran provisioners is optimistic, and users have no way to raise it. Other plugins expose a state_timeout-style option (e.g., DigitalOcean).
Related robustness issues in the same code:
- Wait loops check
ctxonly at the top of the loop, thentime.Sleep(3 * time.Second)unconditionally — Ctrl-C waits out the sleep. Shouldselectonctx.Done()vs a timer. stepInstanceStophalts on the first transientInstanceViewerror mid-poll, while the cleanup path retries the same call — the run path should be at least as tolerant as cleanup.- The data source's
Executeusescontext.TODO()with no timeout; a hung API call hangspacker buildindefinitely.
Fix
- Add config options for state timeouts (and possibly poll interval), threaded into all wait loops and cleanup contexts.
- Make polling cancellation-aware.
- Retry transient errors in wait loops consistently.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with step_instance_create.go and step_instance_stop.go, then trace the cleanup calls and the data source Execute that use context.TODO() and 30-second waits. Review each polling loop and its transient-error handling before deciding how state timeouts and cancellation should be threaded through. Done means lifecycle waits and cleanup honor configured timeouts, polling responds to cancellation, and transient errors are handled consistently.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- devops
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100