oxidecomputer / oxidecomputer/packer-plugin-oxide

Configurable timeouts and cancellation-aware polling

Open
#109 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Enhancement Packer Plugin
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 ctx only at the top of the loop, then time.Sleep(3 * time.Second) unconditionally — Ctrl-C waits out the sleep. Should select on ctx.Done() vs a timer.
  • stepInstanceStop halts on the first transient InstanceView error 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 Execute uses context.TODO() with no timeout; a hung API call hangs packer build indefinitely.

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.