{"record":{"id":"75ce0c6a1898b312","repo":"hashicorp/nomad","slug":"wait-aborted-w","errorCode":null,"errorMessage":"wait aborted: %w","messagePattern":"wait aborted: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"drivers/docker/coordinator.go","lineNumber":49,"sourceCode":"\twaitCh chan struct{}\n\n\terr       error\n\timageID   string\n\timageUser string\n}\n\n// newPullFuture returns a new pull future\nfunc newPullFuture() *pullFuture {\n\treturn &pullFuture{\n\t\twaitCh: make(chan struct{}),\n\t}\n}\n\n// wait waits till the future has a result or the context is canceled\nfunc (p *pullFuture) wait(ctx context.Context) *pullFuture {\n\tselect {\n\tcase <-ctx.Done():\n\t\tp.err = fmt.Errorf(\"wait aborted: %w\", ctx.Err())\n\tcase <-p.waitCh:\n\t\t// all good\n\t}\n\treturn p\n}\n\n// result returns the results of the future and should only ever be called after\n// wait returns.\nfunc (p *pullFuture) result() (imageID, imageUser string, err error) {\n\treturn p.imageID, p.imageUser, p.err\n}\n\n// set is used to set the results and unblock any waiter. This may only be\n// called once.\nfunc (p *pullFuture) set(imageID, imageUser string, err error) {\n\tp.imageID = imageID\n\tp.imageUser = imageUser\n\tp.err = err","sourceCodeStart":31,"sourceCodeEnd":67,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/drivers/docker/coordinator.go#L31-L67","documentation":"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.","triggerScenarios":"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.","commonSituations":"Node drain or job stop during a slow image pull; deployment timeout canceling allocations; agent shutdown while pulls are deduplicated through the coordinator.","solutions":["No action usually needed — the caller canceled the wait intentionally; treat it as an aborted pull and retry on the next placement.","If unexpected, check why the context was canceled (allocation deadline, node drain, agent shutdown) in the surrounding logs.","Increase pull timeouts or pre-pull images to reduce the window where cancellation hits mid-pull.","Use image pull deduplication/keep the coordinator running so a later retry reuses progress."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err != nil {\n    if errors.Is(err, context.Canceled) || strings.Contains(err.Error(), \"wait aborted\") {\n        return nil // caller canceled; expected during stop/drain\n    }\n    return err\n}","preventionTips":["Avoid canceling allocations mid-pull where possible; use pre-pulled images or shorter startup deadlines.","Gracefully drain nodes so in-flight pulls finish or are retried cleanly.","Log context cancellation cause alongside the pull error for triage."],"tags":["docker","context-cancellation","image-pull"],"backgroundTag":"context-canceled","analyzedSha":"482b49bf1aec006f089bcfc7e632d8f6ac303e5e","analyzedAt":"2026-09-04T07:54:14.808Z","contentChangedAt":"2026-09-04T07:54:14.808Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}