Repository navigation
Retry Azure container creation after a failed first attempt - #9
Conversation
The lazy createIfNotExists memo cached rejections as well as successes, so one transient failure (network blip, emulator API-version rejection) latched the store into replaying the same error on every subsequent operation until the host process restarted. Clear the memo on rejection so the next operation retries; the happy path keeps its single-flight memoization. Observed during the Exsimplify migration's Phase 2 boot smoke against Azurite. The S3 and Cloudflare R2 adapters do not lazily create buckets, so only the Azure adapter carried this pattern. Bump all published packages to 0.1.2 (release tooling requires one shared version). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 18802b101a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Pull request overview
Improves the Azure Blob adapter’s lazy container creation so transient failures don’t get permanently memoized, and aligns the monorepo packages to a patch release version bump.
Changes:
- Reset the
ensureContainersingle-flight memo whencreateIfNotExists()rejects, allowing subsequent operations to retry container creation. - Add a regression test covering “fail once, then succeed” behavior for container creation memoization.
- Bump all package versions (and adapter pins) from
0.1.1to0.1.2and resync the lockfile.
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/storage-azure-blob/src/index.ts | Clears the container-creation memo on rejection so retries can occur after transient failures. |
| packages/storage-azure-blob/src/index.test.ts | Adds a regression test asserting retry-after-first-failure and continued memoization after success. |
| packages/storage-blobs/package.json | Bumps @pegma/storage-blobs version to 0.1.2. |
| packages/storage-azure-blob/package.json | Bumps adapter version and updates the pinned @pegma/storage-blobs dependency. |
| packages/storage-s3/package.json | Bumps adapter version and updates the pinned @pegma/storage-blobs dependency. |
| packages/storage-cloudflare-r2/package.json | Bumps adapter version and updates the pinned @pegma/storage-blobs dependency. |
| package-lock.json | Updates workspace package versions and pinned internal dependencies to 0.1.2. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Review feedback: the retry regression test stubbed the whole ContainerClient, which conflicts with the repository rule to verify adapters against a real backend. Use a real client against Azurite and inject the one-shot fault into createIfNotExists only, delegating to the real implementation on retry, so the second attempt actually creates the container and the subsequent head round-trips the emulator. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

Summary
The Azure Blob adapter's lazy container-creation memo cached rejections as well as successes:
ready()setensureContaineronce to thecreateIfNotExists()promise, so a single transient failure (network blip, Azurite API-version rejection) latched the store into replaying the same error on every subsequent operation until the host process restarted. Observed empirically during the Exsimplify migration's Phase 2 boot smoke — identical error RequestId returned minutes apart, across an emulator restart.ContainerClientwhosecreateIfNotExistsrejects once then succeeds — first op fails, second op succeeds, and success stays memoized (exactly 2 create attempts). Verified the test fails against the unfixed code. A stub is used because Azurite can't be induced to fail exactly once; the conformance suites still run against the real emulator.storage-s3norstorage-cloudflare-r2lazily creates buckets, so the latching pattern was Azure-only.@pegma/storage-blobsupdated, lockfile re-synced.Testing
npm test: 224/224 across all five test files (Azurite + LocalStack via Docker)npm run checkandprettier --checkpass🤖 Generated with Claude Code