Skip to content

archive: support canceling directory comparisons - #132

Open
sairex53 wants to merge 1 commit into
moby:mainfrom
sairex53:codex/changes-dirs-context
Open

sairex53 wants to merge 1 commit into
moby:mainfrom
sairex53:codex/changes-dirs-context

Conversation

@sairex53

Copy link
Copy Markdown

Summary

Add ChangesDirsContext so callers can stop a recursive directory comparison when their request is canceled. Keep ChangesDirs source-compatible by delegating to the new API with a background context.

Propagate cancellation through the Linux and non-Linux tree walkers and through change collection, returning no partial result after cancellation.

This lets Moby stop expensive container diff scans after a client disconnects or request timeout.

Testing

  • go test ./...
  • Cross-compiled package tests for Darwin/arm64 and Windows/arm64
  • git diff --check

Signed-off-by: Eduard Zateev <hackerowskiy@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant