Skip to content

use abort controller for stopping pending timers#8134

Draft
n1ru4l wants to merge 2 commits into
redis-iam-authfrom
redis-iam-abort-controller
Draft

use abort controller for stopping pending timers#8134
n1ru4l wants to merge 2 commits into
redis-iam-authfrom
redis-iam-abort-controller

Conversation

@n1ru4l

@n1ru4l n1ru4l commented Jun 10, 2026

Copy link
Copy Markdown
Contributor
  • Use an abort controller to stop a retry timer halting graceful process exit.
  • Lift timer cleanup and handle it gracefully instead of using unref

@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 refactors the IAM token refresh mechanism to use AbortController and node:timers/promises for cleaner shutdown handling, binds the token refresh cleanup to the Redis client's end event, and updates the workflow shutdown sequence to quit Redis clients. A review comment correctly identifies a nested await inside Promise.all during the Redis subscriber shutdown, which prevents concurrent execution and should be removed.

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.

logger.info('Shutdown postgres connection successful.');
logger.info('Shutdown redis connection.');
redis.disconnect(false);
await Promise.all([redis.quit(), await redisSubscriber.quit()]);

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.

medium

Using await inside Promise.all defeats the purpose of concurrent execution because redisSubscriber.quit() will be awaited sequentially before Promise.all is invoked. Remove the nested await to allow both quit operations to run concurrently.

      await Promise.all([redis.quit(), redisSubscriber.quit()]);

@github-actions

github-actions Bot commented Jun 10, 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/apollo 0.48.1-alpha-20260610091846-3aa9ed330e372fd50d62a994cd3b5fdc4df49586 npm ↗︎ unpkg ↗︎
@graphql-hive/cli 0.60.1-alpha-20260610091846-3aa9ed330e372fd50d62a994cd3b5fdc4df49586 npm ↗︎ unpkg ↗︎
@graphql-hive/core 0.21.1-alpha-20260610091846-3aa9ed330e372fd50d62a994cd3b5fdc4df49586 npm ↗︎ unpkg ↗︎
@graphql-hive/envelop 0.40.6-alpha-20260610091846-3aa9ed330e372fd50d62a994cd3b5fdc4df49586 npm ↗︎ unpkg ↗︎
@graphql-hive/yoga 0.48.1-alpha-20260610091846-3aa9ed330e372fd50d62a994cd3b5fdc4df49586 npm ↗︎ unpkg ↗︎
hive 11.3.0-alpha-20260610091846-3aa9ed330e372fd50d62a994cd3b5fdc4df49586 npm ↗︎ unpkg ↗︎

Comment thread packages/services/workflows/src/index.ts Outdated
logger.info('Shutdown postgres connection successful.');
logger.info('Shutdown redis connection.');
redis.disconnect(false);
await Promise.all([redis.quit(), redisSubscriber.quit()]);

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.

unrelated the the actual changes 😓 - i just noticed we are not cleaning up the subscriber client

@n1ru4l n1ru4l mentioned this pull request Jun 10, 2026
14 tasks
@github-actions

github-actions Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

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

Targets: build

Platforms: linux/amd64

Image Tag: 3aa9ed330e372fd50d62a994cd3b5fdc4df49586

@n1ru4l n1ru4l marked this pull request as draft June 10, 2026 09:27
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