hashicorp/nomad · warning

wait aborted: %w

Error message

wait aborted: %w

What it means

pullFuture.wait blocks until an image pull completes or the caller's context is canceled. On cancellation the future's error is set to "wait aborted" wrapping ctx.Err(). This surfaces to whoever requested the pull as an aborted wait, typically when a task/allocation is being shut down or the pull deadline expired.

Source

Thrown at drivers/docker/coordinator.go:49

	waitCh chan struct{}

	err       error
	imageID   string
	imageUser string
}

// newPullFuture returns a new pull future
func newPullFuture() *pullFuture {
	return &pullFuture{
		waitCh: make(chan struct{}),
	}
}

// wait waits till the future has a result or the context is canceled
func (p *pullFuture) wait(ctx context.Context) *pullFuture {
	select {
	case <-ctx.Done():
		p.err = fmt.Errorf("wait aborted: %w", ctx.Err())
	case <-p.waitCh:
		// all good
	}
	return p
}

// result returns the results of the future and should only ever be called after
// wait returns.
func (p *pullFuture) result() (imageID, imageUser string, err error) {
	return p.imageID, p.imageUser, p.err
}

// set is used to set the results and unblock any waiter. This may only be
// called once.
func (p *pullFuture) set(imageID, imageUser string, err error) {
	p.imageID = imageID
	p.imageUser = imageUser
	p.err = err

View on GitHub (pinned to 482b49bf1a)

Solutions

  1. No action usually needed — the caller canceled the wait intentionally; treat it as an aborted pull and retry on the next placement.
  2. If unexpected, check why the context was canceled (allocation deadline, node drain, agent shutdown) in the surrounding logs.
  3. Increase pull timeouts or pre-pull images to reduce the window where cancellation hits mid-pull.
  4. Use image pull deduplication/keep the coordinator running so a later retry reuses progress.
Defensive patterns

Strategy: try-catch

Try / catch

if err != nil {
    if errors.Is(err, context.Canceled) || strings.Contains(err.Error(), "wait aborted") {
        return nil // caller canceled; expected during stop/drain
    }
    return err
}

Prevention

When it happens

Trigger: Calling the coordinator's pull (via pullFuture.wait) and canceling the passed context before the pull finishes — e.g. allocation kill, task stop, or driver shutdown while a pull is in flight.

Common situations: Node drain or job stop during a slow image pull; deployment timeout canceling allocations; agent shutdown while pulls are deduplicated through the coordinator.

Related errors


AI-assisted analysis of hashicorp/nomad@482b49bf1a (2026-09-04). Data as JSON: /api/errors/75ce0c6a1898b312. Report an issue: GitHub.