Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#2044 Add Ignore errors and timeout for ORM Cache #2130

Merged
merged 4 commits into from
Jul 27, 2023

Conversation

dheepak-aot
Copy link
Collaborator

@dheepak-aot dheepak-aot commented Jul 26, 2023

Ignore Errors and add timeout

  • Added ignoreErrors: true to the orm cache config.
  • Set commandTimeout of redis to 60 seconds in cache config which is infinite by default.

Retry Strategy (https://github.com/redis/ioredis/tree/v4#auto-reconnect)

When ignoreErrors: true is set, errors are ignored and the typeorm works normally but the redis client(ioredis and ioredis/cluster) does retry every 2 seconds to connect again to redis server and creates log for every retry.

This is due to the default implementation of retryStrategy and clusterRetryStrategy.

image

image

  • Hence the connection retry interval has been set to 60 seconds for orm config.

Sorry, something went wrong.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Copy link
Collaborator

@andrewsignori-aot andrewsignori-aot left a comment

Choose a reason for hiding this comment

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

Nicely done and thanks for the further explanations on the PR description. Looks good 👍

* Ref for cluster: https://github.com/redis/ioredis/tree/v4#cluster
*/
export const ORM_CACHE_REDIS_RETRY_INTERVAL = 60 * 1000;

Copy link
Collaborator

Choose a reason for hiding this comment

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

For my understanding. Why are we having the redis retry and the timeout same interval? Doesnt the retry should be lesser or the timeout more?

},
ignoreErrors: true,
Copy link
Collaborator

Choose a reason for hiding this comment

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

👍

Copy link
Contributor

@ann-aot ann-aot left a comment

Choose a reason for hiding this comment

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

👍

Copy link
Collaborator

@sh16011993 sh16011993 left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@github-actions
Copy link

Backend Unit Tests Coverage Report

Totals Coverage
Statements: 17.87% ( 2137 / 11957 )
Methods: 8.26% ( 126 / 1525 )
Lines: 20.68% ( 1873 / 9059 )
Branches: 10.05% ( 138 / 1373 )

@github-actions
Copy link

E2E Workflow Workers Coverage Report

Totals Coverage
Statements: 49.81% ( 267 / 536 )
Methods: 41.56% ( 32 / 77 )
Lines: 55.33% ( 218 / 394 )
Branches: 26.15% ( 17 / 65 )

@github-actions
Copy link

E2E Queue Consumers Coverage Report

Totals Coverage
Statements: 72.5% ( 406 / 560 )
Methods: 63.38% ( 45 / 71 )
Lines: 74.53% ( 357 / 479 )
Branches: 40% ( 4 / 10 )

@github-actions
Copy link

E2E SIMS API Coverage Report

Totals Coverage
Statements: 52.19% ( 3723 / 7134 )
Methods: 48.49% ( 449 / 926 )
Lines: 57.31% ( 3051 / 5324 )
Branches: 25.23% ( 223 / 884 )

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

Copy link
Collaborator

@guru-aot guru-aot left a comment

Choose a reason for hiding this comment

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

LGTM, nice work @dheepak-aot

@dheepak-aot dheepak-aot merged commit 4ea9a7c into main Jul 27, 2023
@dheepak-aot dheepak-aot temporarily deployed to DEV July 27, 2023 19:03 — with GitHub Actions Inactive
@dheepak-aot dheepak-aot temporarily deployed to DEV July 27, 2023 19:06 — with GitHub Actions Inactive
@dheepak-aot dheepak-aot temporarily deployed to DEV July 27, 2023 19:06 — with GitHub Actions Inactive
@dheepak-aot dheepak-aot temporarily deployed to DEV July 27, 2023 19:06 — with GitHub Actions Inactive
@dheepak-aot dheepak-aot temporarily deployed to DEV July 27, 2023 19:06 — with GitHub Actions Inactive
@dheepak-aot dheepak-aot temporarily deployed to DEV July 27, 2023 19:08 — with GitHub Actions Inactive
@dheepak-aot dheepak-aot temporarily deployed to DEV July 27, 2023 19:08 — with GitHub Actions Inactive
@dheepak-aot dheepak-aot deleted the fix/#2044-ignore-errors-and-timeout-redis-cache branch August 1, 2023 22:02
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.

None yet

5 participants