Skip to content

feat: schema delete retries#8230

Open
n1ru4l wants to merge 1 commit into
mainfrom
feat-cli-delete-retry
Open

feat: schema delete retries#8230
n1ru4l wants to merge 1 commit into
mainfrom
feat-cli-delete-retry

Conversation

@n1ru4l

@n1ru4l n1ru4l commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Background

For busy projects it is possible that the registry lock acquiring times out. For the schema publishing process we already introduced automatic retries. This also introduces the changes for the schema delete process.

Description

Implement the same behaviour as for schema publishes for retrying from the client side if the registry lock can not be acquired.

Note: I did not add tests as these would require running for a long time (and we also do not have them for the schema publishing counterpart).

I manually tested this be introducing a sleep statement into the schema publish/delete process.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The noise here is mostly indent changing. Relevant changes start at L1670

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request adds support for retrying schema deletion when the registry is busy or locked. Feedback highlights several critical issues: a GraphQL syntax error where False is capitalized instead of lowercase false, a resolver bug where the supportsRetry flag is not forwarded to the publisher, a tight loop in the CLI retry logic that lacks a delay, and an inaccurate retry reason string referencing 'publish' instead of 'operation' during a delete.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread packages/services/api/src/modules/schema/module.graphql.ts Outdated
Comment on lines +166 to +169
if (result.schemaDelete.__typename === 'SchemaDeleteRetry') {
this.log(result.schemaDelete.reason);
this.log('Waiting for other schema registry actions to complete...');
result = null;

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.

high

Retrying immediately without any delay creates a tight loop that will hammer the registry API with requests as fast as possible. When implementing a polling mechanism, consider using a longer default interval (e.g., 5-10 seconds) to avoid excessive network requests and potential server load or rate limiting issues.

Suggested change
if (result.schemaDelete.__typename === 'SchemaDeleteRetry') {
this.log(result.schemaDelete.reason);
this.log('Waiting for other schema registry actions to complete...');
result = null;
if (result.schemaDelete.__typename === 'SchemaDeleteRetry') {
this.log(result.schemaDelete.reason);
this.log('Waiting for other schema registry actions to complete...');
await new Promise(resolve => setTimeout(resolve, 5000));
result = null;
References
  1. Focus: Correctness and Performance. Tight loops without delay can cause performance issues and rate-limiting. (link)
  2. When implementing a polling mechanism, consider the appropriate polling interval to avoid excessive network requests and potential server load or rate limiting issues. A longer default interval (e.g., 5-10 seconds or more) is generally more robust.

@n1ru4l n1ru4l Jul 17, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think it is not needed as the server lock acquiring will only time out after 20 seconds or so.

"""
Whether the client supports retries in case the registry is busy and the operation could not be performed.
"""
supportsRetry: Boolean = False

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

New clients need to specify that, as old clients do not gracefully handle the SchemaDeleteRetry type member.

@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

🚀 Snapshot Release (alpha)

The latest changes of this PR are available as alpha on npm (based on the declared changesets):

Package Version Info
@graphql-hive/cli 0.61.0-alpha-20260717063721-d5dddb2e7d3138bb3c9c545a789354da5bce49f8 npm ↗︎ unpkg ↗︎
hive 11.7.0-alpha-20260717063721-d5dddb2e7d3138bb3c9c545a789354da5bce49f8 npm ↗︎ unpkg ↗︎

@n1ru4l
n1ru4l force-pushed the feat-cli-delete-retry branch 3 times, most recently from 21e9c0f to 091a1ad Compare July 17, 2026 06:30
@n1ru4l
n1ru4l force-pushed the feat-cli-delete-retry branch from 091a1ad to d5dddb2 Compare July 17, 2026 06:36
@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

🐋 This PR was built and pushed to the following Docker images:

Targets: build

Platforms: linux/amd64

Image Tags: 11.7.0-alpha-d5dddb2, d5dddb2, d5dddb2e7d3138bb3c9c545a789354da5bce49f8

@n1ru4l
n1ru4l marked this pull request as ready for review July 17, 2026 07:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant