Skip to content

Retry APIM pessimistic concurrency conflicts - #255

Merged
2 commits merged into
mainfrom
copilot/fix-409-pessimistic-concurrency-conflict
Sep 4, 2026
Merged

Retry APIM pessimistic concurrency conflicts#255
2 commits merged into
mainfrom
copilot/fix-409-pessimistic-concurrency-conflict

Conversation

Copilot AI commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

APIM may return 409 PessimisticConcurrencyConflict while an API operation is still settling. Publishing should retry this transient lock instead of failing immediately.

  • Retry handling

    • Route the specific conflict through the existing bounded exponential backoff.
    • Preserve hard-failure behavior for all other 409 responses.
  • Regression coverage

    • Cover successful retry after the API lock clears.
    • Verify unrelated conflicts are not retried.
error.status === 409 &&
error.code === 'PessimisticConcurrencyConflict'

Copilot AI balanced review requested due to automatic review settings August 31, 2026 23:05

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review any files in this pull request.


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Co-authored-by: azaslonov <2320302+azaslonov@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix 409 PessimisticConcurrencyConflict to retry operation Retry APIM pessimistic concurrency conflicts Aug 31, 2026
@Alexey-Zheltov

Copy link
Copy Markdown
Collaborator

Tested this locally in a dev container on top of latest main:

  • npm ci / npm run build — clean, no errors
  • npm test — all 60 test files passed, 1322/1322 tests passed
  • Confirmed in the logs that the retry logic correctly kicks in on 409 PessimisticConcurrencyConflict, with exponential backoff as described (e.g. Request failed: HTTP 409 ... PessimisticConcurrencyConflict, retrying after ~1.1s)

Also merged this together with #256 into a combined branch to check for conflicts — no conflicts (this PR only touches src/clients/apim-client.ts, #256 only touches src/services/publish-service.ts), and all 1323 tests still pass on the combined branch.

LGTM from a testing standpoint 👍

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM — retry logic correctly scoped to PessimisticConcurrencyConflict only, verified locally with full test suite passing and no conflicts with #256.

@azaslonov Alexander Zaslonov (azaslonov) closed this pull request by merging all changes into main in 42f182d Sep 4, 2026
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.

409 PessimisticConcurrencyConflict ("operation in progress") is treated as a hard failure instead of being retried

4 participants